Home Reference Source
import {Timer} from 'postprocessing'
public class | source

Timer

Implements:

this class was deprecated. Use `three/addons/misc/Timer.js` instead.

A timer.

Original implementation by Michael Herzog (Mugen87).

Constructor Summary

Public Constructor
public

Constructs a new timer.

Member Summary

Public Members
public get

Enables or disables auto reset based on page visibility.

public set
public get

delta: *

public get

elapsed: *

public get
public set
public

The timescale.

public

Determines whether this timer should use a fixed time step.

Method Summary

Public Methods
public
public

getDelta(): *

public

getElapsed(): *

public

handleEvent(e: *)

public

reset()

Resets this timer.

public

update(timestamp: Boolean)

Updates this timer.

Public Constructors

public constructor() source

Constructs a new timer.

Public Members

public get autoReset: Boolean source

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.

See:

public set autoReset source

public get delta: * source

public get elapsed: * source

public get fixedDelta: * source

public set fixedDelta source

public timescale: Number source

The timescale.

public useFixedDelta: Boolean source

Determines whether this timer should use a fixed time step.

Public Methods

public dispose() source

public getDelta(): * source

Return:

*

public getElapsed(): * source

Return:

*

public handleEvent(e: *) source

Params:

NameTypeAttributeDescription
e *

public reset() source

Resets this timer.

public update(timestamp: Boolean) source

Updates this timer.

Params:

NameTypeAttributeDescription
timestamp Boolean
  • optional

The current time in milliseconds.