public class LwjglSmoothingTimer
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.| Modifier and Type | Field and Description |
|---|---|
static long |
LWJGL_TIME_TO_NANOS |
static int |
TIMER_SMOOTHNESS |
| Constructor and Description |
|---|
LwjglSmoothingTimer()
Constructor builds a
Timer object. |
| Modifier and Type | Method and Description |
|---|---|
float |
getFrameRate()
getFrameRate returns the current frame rate since the last
call to update. |
long |
getResolution() |
long |
getTime() |
float |
getTimePerFrame() |
void |
reset() |
java.lang.String |
toString()
toString returns the string representation of this timer
in the format: jme.utility.Timer@1db699b Time: {LONG} FPS: {LONG} |
void |
update()
update recalculates the frame rate based on the previous
call to update. |
public static int TIMER_SMOOTHNESS
public static final long LWJGL_TIME_TO_NANOS
public LwjglSmoothingTimer()
Timer object. All values will be
initialized to its default values.public void reset()
reset in class com.jme3.system.Timerpublic long getTime()
getTime in class com.jme3.system.TimerTimer.getTime()public long getResolution()
getResolution in class com.jme3.system.TimerTimer.getResolution()public float getFrameRate()
getFrameRate returns the current frame rate since the last
call to update.getFrameRate in class com.jme3.system.Timerpublic float getTimePerFrame()
getTimePerFrame in class com.jme3.system.Timerpublic void update()
update recalculates the frame rate based on the previous
call to update. It is assumed that update is called each frame.update in class com.jme3.system.Timerpublic java.lang.String toString()
toString returns the string representation of this timer
in the format: toString in class java.lang.Object