Package com.jme3.system.lwjgl
Class LwjglSmoothingTimer
java.lang.Object
com.jme3.system.Timer
com.jme3.system.lwjgl.LwjglSmoothingTimer
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.- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final longstatic int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfloatgetFrameRatereturns the current frame rate since the last call toupdate.longReturns the resolution of the timer.longgetTime()Returns the current time in ticks.floatReturns the time, in seconds, between the last call and the current one.voidreset()Reset the timer to 0.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.Methods inherited from class com.jme3.system.TimergetTimeInSeconds
- 
Field Details- 
TIMER_SMOOTHNESSpublic static int TIMER_SMOOTHNESS
- 
LWJGL_TIME_TO_NANOSpublic static final long LWJGL_TIME_TO_NANOS
 
- 
- 
Constructor Details- 
LwjglSmoothingTimerpublic LwjglSmoothingTimer()Constructor builds aTimerobject. All values will be initialized to its default values.
 
- 
- 
Method Details- 
resetpublic void reset()Description copied from class:TimerReset the timer to 0. Clear any tpf history.
- 
getTimepublic long getTime()Description copied from class:TimerReturns the current time in ticks. A tick is an arbitrary measure of time defined by the timer implementation. The number of ticks per second is given bygetResolution(). The timer starts at 0 ticks.
- 
getResolutionpublic long getResolution()Description copied from class:TimerReturns the resolution of the timer.- Specified by:
- getResolutionin class- Timer
- Returns:
- the number of timer ticks per second
- See Also:
 
- 
getFrameRatepublic float getFrameRate()getFrameRatereturns the current frame rate since the last call toupdate.- Specified by:
- getFrameRatein class- Timer
- Returns:
- the current frame rate.
 
- 
getTimePerFramepublic float getTimePerFrame()Description copied from class:TimerReturns the time, in seconds, between the last call and the current one.- Specified by:
- getTimePerFramein class- Timer
- Returns:
- Time between this call and the last one.
 
- 
updatepublic void update()updaterecalculates the frame rate based on the previous call to update. It is assumed that update is called each frame.
- 
toStringtoStringreturns the string representation of this timer in the format:
 
 jme.utility.Timer@1db699b
 Time: {LONG}
 FPS: {LONG}
 
-