public abstract class Timer
extends java.lang.Object
Timer
is the base class for a high resolution timer. It is
created from getTimer("display system")Constructor and Description |
---|
Timer() |
Modifier and Type | Method and Description |
---|---|
abstract float |
getFrameRate()
Returns the "calls per second".
|
abstract long |
getResolution()
Returns the resolution of the timer.
|
abstract long |
getTime()
Returns the current time in ticks.
|
float |
getTimeInSeconds()
Returns the time in seconds.
|
abstract float |
getTimePerFrame()
Returns the time, in seconds, between the last call and the current one.
|
abstract void |
reset()
Reset the timer to 0.
|
abstract void |
update()
update recalculates the frame rate based on the previous
call to update. |
public abstract long getTime()
getResolution()
. The timer starts at 0 ticks.public float getTimeInSeconds()
public abstract long getResolution()
public abstract float getFrameRate()
public abstract float getTimePerFrame()
public abstract void update()
update
recalculates the frame rate based on the previous
call to update. It is assumed that update is called each frame.public abstract void reset()