Time is a class that provides time-related information.
It is created and used within the Needle Engine Context.

Implements

Constructors

Properties

timeScale: number = 1

The scale at which time passes. This can be used for slow motion effects or to speed up time.

Accessors

  • get deltaTime(): number
  • The time in seconds it took to complete the last frame (Read Only).

    Returns number

  • set deltaTime(value): void
  • Parameters

    • value: number

    Returns void

  • get deltaTimeUnscaled(): number
  • The time in seconds it took to complete the last frame (Read Only). Timescale is not applied.

    Returns number

  • get frame(): number
  • same as frameCount

    Returns number

  • set frame(value): void
  • Parameters

    • value: number

    Returns void

  • get frameCount(): number
  • The total number of frames that have passed (Read Only). Same as frame

    Returns number

  • get realtimeSinceStartup(): number
  • The time in seconds it took to complete the last frame (Read Only).

    Returns number

  • get smoothedDeltaTime(): number
  • The smoothed time in seconds it took to complete the last frame (Read Only).

    Returns number

  • get smoothedFps(): number
  • Approximated frames per second (Read Only).

    Returns number

  • get time(): number
  • The time in seconds since the start of Needle Engine.

    Returns number

  • set time(value): void
  • Parameters

    • value: number

    Returns void