Class: Clock

util.Clock()

new Clock()

Clock is a MonotonicClock that also offers the possibility of being reset.

Source:

Extends

  • MonotonicClock

Methods

add(deltaTimeopt)

Add more time to the clock's 'start' time (t0).

Note: by adding time to t0, the current time is pushed forward (it becomes smaller). As a consequence, getTime() may return a negative number.

Parameters:
Name Type Attributes Description
deltaTime number <optional>
the time to be added to the clock's start time (t0)
Source:

reset(newTimeopt)

Reset the time on the clock.
Parameters:
Name Type Attributes Default Description
newTime number <optional>
0 the new time on the clock.
Source: