Package de.coreengine.util
Class FrameTimer
- java.lang.Object
-
- de.coreengine.util.FrameTimer
-
public class FrameTimer extends Object
Class that calculates the time since last second and the fps- Author:
- Darius Dinger
-
-
Constructor Summary
Constructors Constructor Description FrameTimer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getFps()
static float
getTslf()
static void
setSmoothFps(boolean smoothFps)
If smooth fps is enabled, the fps will be calculated by the average of the last fps (fps = (fps + newFps) / 2)static void
update()
Recalculate the fps and tslf.
-
-
-
Method Detail
-
update
public static void update()
Recalculate the fps and tslf. Must be called once at every frame
-
getFps
public static int getFps()
- Returns:
- Frames in the last second
-
getTslf
public static float getTslf()
- Returns:
- Time (seconds) since last frame
-
setSmoothFps
public static void setSmoothFps(boolean smoothFps)
If smooth fps is enabled, the fps will be calculated by the average of the last fps (fps = (fps + newFps) / 2)- Parameters:
smoothFps
- Should be used smooth fps
-
-