Package com.jme3.system
Class Timer
java.lang.Object
com.jme3.system.Timer
- Direct Known Subclasses:
- LwjglSmoothingTimer,- LwjglTimer,- NanoTimer,- VideoRecorderAppState.IsoTimer
Timer is the base class for a high resolution timer. It is
 created from getTimer("display system")- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract floatReturns the "calls per second".abstract longReturns the resolution of the timer.abstract longgetTime()Returns the current time in ticks.floatReturns the time in seconds.abstract floatReturns the time, in seconds, between the last call and the current one.abstract voidreset()Reset the timer to 0.abstract voidupdate()updaterecalculates the frame rate based on the previous call to update.
- 
Constructor Details- 
Timerpublic Timer()
 
- 
- 
Method Details- 
getTimepublic abstract long getTime()Returns 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.- Returns:
- a long value representing the current time
 
- 
getTimeInSecondspublic float getTimeInSeconds()Returns the time in seconds. The timer starts at 0.0 seconds.- Returns:
- the current time in seconds
 
- 
getResolutionpublic abstract long getResolution()Returns the resolution of the timer.- Returns:
- the number of timer ticks per second
 
- 
getFrameRatepublic abstract float getFrameRate()Returns the "calls per second". If this is called every frame, then it will return the "frames per second".- Returns:
- The "calls per second".
 
- 
getTimePerFramepublic abstract float getTimePerFrame()Returns the time, in seconds, between the last call and the current one.- Returns:
- Time between this call and the last one.
 
- 
updatepublic abstract void update()updaterecalculates the frame rate based on the previous call to update. It is assumed that update is called each frame.
- 
resetpublic abstract void reset()Reset the timer to 0. Clear any tpf history.
 
-