Class: Timer

Splat. Timer

new Timer(onTick, expireMillis, onExpire)

A timer that calls callbacks while it is running, and when it expires.
Parameters:
Name Type Description
onTick simulationCallback Called when the Timer is tick()ed
expireMillis number The number of milliseconds until the Timer expires
onExpire emptyCallback Called when the Timer expires
Source:

Methods

expired() → {boolean}

Test if the Timer has expired.
Source:
Returns:
Type
boolean

reset()

Zeroes the timer. This does not stop the Timer!
Source:

start()

Start the Timer running. This does not reset the Timer!
Source:

stop()

Stop the Timer. This does not reset the Timer!
Source:

tick(elapsedMillis)

Advance the Timer. Normally Splat.Scene does this for you.
Parameters:
Name Type Description
elapsedMillis number How many milliseconds to advance the timer.
Source: