A timer.

Original implementation by Michael Herzog (Mugen87).

Deprecated

Use three/addons/misc/Timer.js instead.

Implements

Implements

Implements

Hierarchy

  • Timer

Implements

Constructors

Properties

timescale: number

The timescale.

useFixedDelta: boolean

Determines whether this timer should use a fixed time step.

Accessors

  • get autoReset(): boolean
  • Enables or disables auto reset based on page visibility.

    If enabled, the timer will be reset when the page becomes visible. This effectively pauses the timer when the page is hidden. Has no effect if the API is not supported.

    Returns boolean

  • set autoReset(value): void
  • Parameters

    • value: boolean

    Returns void

  • get delta(): number
  • The current delta time in seconds.

    Returns number

  • get elapsed(): number
  • The elapsed time in seconds.

    Returns number

  • get fixedDelta(): number
  • The fixed delta time in seconds.

    Returns number

  • set fixedDelta(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Disposes this timer.

    Returns void

  • The current delta time in seconds.

    Returns number

  • Parameters

    • object: Event

    Returns void

  • Resets this timer.

    Returns Timer

    This timer.

  • Updates this timer.

    Parameters

    • Optional timestamp: number

      The current time in milliseconds.

    Returns void