Package com.jme3.system.lwjgl
Class LwjglTimer
java.lang.Object
com.jme3.system.Timer
com.jme3.system.lwjgl.LwjglTimer
public class LwjglTimer
extends com.jme3.system.Timer
Timer handles the system's time related functionality. This
allows the calculation of the framerate. To keep the framerate calculation
accurate, a call to update each frame is required. Timer is a
singleton object and must be created via the getTimer method.- Author:
- Mark Powell
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetFrameRatereturns the current frame rate since the last call toupdate.longlonggetTime()floatfloatvoidreset()toString()toStringreturns the string representation of this timer in the format:
jme.utility.Timer@1db699b
Time: {LONG}
FPS: {LONG}voidupdate()updaterecalculates the frame rate based on the previous call to update.
-
Field Details
-
LWJGL_TIME_TO_NANOS
public static final long LWJGL_TIME_TO_NANOS
-
-
Constructor Details
-
LwjglTimer
public LwjglTimer()Constructor builds aTimerobject. All values will be initialized to its default values.
-
-
Method Details
-
reset
public void reset()- Specified by:
resetin classcom.jme3.system.Timer
-
getTimeInSeconds
public float getTimeInSeconds()- Overrides:
getTimeInSecondsin classcom.jme3.system.Timer
-
getTime
public long getTime()- Specified by:
getTimein classcom.jme3.system.Timer- See Also:
-
Timer.getTime()
-
getResolution
public long getResolution()- Specified by:
getResolutionin classcom.jme3.system.Timer- See Also:
-
Timer.getResolution()
-
getFrameRate
public float getFrameRate()getFrameRatereturns the current frame rate since the last call toupdate.- Specified by:
getFrameRatein classcom.jme3.system.Timer- Returns:
- the current frame rate.
-
getTimePerFrame
public float getTimePerFrame()- Specified by:
getTimePerFramein classcom.jme3.system.Timer
-
update
public void update()updaterecalculates the frame rate based on the previous call to update. It is assumed that update is called each frame.- Specified by:
updatein classcom.jme3.system.Timer
-
toString
toStringreturns the string representation of this timer in the format:
jme.utility.Timer@1db699b
Time: {LONG}
FPS: {LONG}
-