Timeout

Timeout

Replacement class for `setTimeout`

Constructor

new Timeout(callback, time, startopt)

Source:
Parameters:
Name Type Attributes Description
callback function function to be called when given time passes
time number time in ms to fire the callback
start boolean <optional>
start the timer

Methods

start(newTimeopt) → {Timeout}

Source:
Starts or restarts the timer
Parameters:
Name Type Attributes Description
newTime number <optional>
override time to call the callback
Returns:
- current instance
Type
Timeout

stop() → {Timeout}

Source:
Stops the timer, so callback won't be fired
Returns:
- current instance
Type
Timeout