Class Time

Manages all time related functionality.

Sim thread only unless where specified otherwise.

Constructors

Accessors

  • get fixedDelta(): number
  • Gets the fixed time since last frame was executed, in seconds. Only gets updated once per frame.

    Returns number

  • get frameDelta(): number
  • Gets the time since last frame was executed, in seconds. Only gets updated once per frame.

    Returns number

  • get frameIndex(): number
  • Returns the sequential index of the current frame. First frame is 0.

    Returns number

  • get microToSecond(): number
  • Multiply this with time in microseconds to get a time in seconds.

    Returns number

  • get precise(): number
  • Returns the precise time since application start, in microseconds. Unlike other time methods this is not only updated every frame, but will return exact time at the moment it is called.

    Returns number

    Time in microseconds.

    You will generally only want to use this for performance measurements and similar. Use non-precise methods in majority of code as it is useful to keep the time value equal in all methods during a single frame.

  • get realElapsed(): number
  • Gets the time elapsed since application start, in seconds. Only gets updated once per frame.

    Returns number

  • get secondToMicro(): number
  • Multiply this with time to convert seconds to microseconds.

    Returns number