Skip to content

Clock

new Clock(autoStart?: boolean)

THREE equivalent: THREE.Clock

Frame-delta timer. Access the delta getter each frame to drive animations. Auto-starts on first access when autoStart is true.

Differs from THREE.js

getDelta() is a getter (clock.delta) rather than a method call. getElapsedTime() is likewise clock.elapsedTime.

Name Type Description
delta number Seconds elapsed since the last time delta was accessed. Auto-starts the clock if autoStart is true.
elapsedTime number Total seconds elapsed since the clock started.
Method Description
start(): void Starts or restarts the clock, resetting elapsedTime to zero.
stop(): void Stops the clock and disables autoStart.