Clock

Object for keeping track of time.

Constructor

Clock( autoStart )

autoStart — Automatically start the clock. Default is true.

Properties

.autoStart

If set, starts the clock automatically when the first update is called.

.startTime

When the clock is running, It holds the start time of the clock.
This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

.oldTime

When the clock is running, It holds the previous time from a update.
This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

.elapsedTime

When the clock is running, It holds the time elapsed between the start of the clock to the previous update.
This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.

.running

This property keeps track whether the clock is running or not.

Methods

.start ()

Starts clock.

.stop ()

Stops clock.

.getElapsedTime ()

Get the seconds passed since the clock started.

.getDelta ()

Get the seconds passed since the last call to this method.

Source

src/core/Clock.js
Edit