Class LwjglSmoothingTimer

java.lang.Object
com.jme3.system.Timer
com.jme3.system.lwjgl.LwjglSmoothingTimer

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.
Author:
Mark Powell
  • Field Details

    • TIMER_SMOOTHNESS

      public static int TIMER_SMOOTHNESS
    • LWJGL_TIME_TO_NANOS

      public static final long LWJGL_TIME_TO_NANOS
  • Constructor Details

    • LwjglSmoothingTimer

      public LwjglSmoothingTimer()
      Constructor builds a Timer object. All values will be initialized to its default values.
  • Method Details

    • reset

      public void reset()
      Specified by:
      reset in class com.jme3.system.Timer
    • getTime

      public long getTime()
      Specified by:
      getTime in class com.jme3.system.Timer
      See Also:
      • Timer.getTime()
    • getResolution

      public long getResolution()
      Specified by:
      getResolution in class com.jme3.system.Timer
      See Also:
      • Timer.getResolution()
    • getFrameRate

      public float getFrameRate()
      getFrameRate returns the current frame rate since the last call to update.
      Specified by:
      getFrameRate in class com.jme3.system.Timer
      Returns:
      the current frame rate.
    • getTimePerFrame

      public float getTimePerFrame()
      Specified by:
      getTimePerFrame in class com.jme3.system.Timer
    • update

      public void update()
      update recalculates the frame rate based on the previous call to update. It is assumed that update is called each frame.
      Specified by:
      update in class com.jme3.system.Timer
    • toString

      public String toString()
      toString returns the string representation of this timer in the format:

      jme.utility.Timer@1db699b
      Time: {LONG}
      FPS: {LONG}
      Overrides:
      toString in class Object
      Returns:
      the string representation of this object.