Periodically executes a callback function.
requestAnimationFrame to repeatedly schedule the callback.
On older browsers the
setTimeout function is used, see setLegacy.
If the period is left at the default value of zero, then the callback fires at the
rate determined by
requestAnimationFrame, usually 60 frames per second.
If the period is set to a slower frame rate than 60 fps then Timer skips firing the callback occasionally to achieve that slower rate of firing.
See BlankSlateApp for example code using a Timer.
the callback function
How late the last callback was.
When last callback happened
Whether the Timer should be executing the callBacks.
Whether running under a modern or old browser.
period between callbacks, in seconds
the ID used to cancel the callback
Returns whether the legacy timer is being used.
whether the legacy timer is being used
Returns the default time period between callbacks in seconds of system clock time.
the number of seconds between successive callbacks
Whether the chain of callbacks is firing (executing)
Sets the callback function to be executed periodically, and calls stopFiring to stop the Timer and any previously scheduled callback.
the function to be called periodically; can be
Sets whether to use the legacy timer.
whether to use the legacy timer
Sets the default time period between callback execution in seconds of system clock time. A setting of zero means to use the default period which is usually 60 frames per second.
the number of seconds between successive callbacks, or zero to use the default period (usually 60 frames per second).
if period is negative
Immediately fires the callback and schedules the callback to fire repeatedly in the future.
Stops the Timer from firing callbacks and cancels the next scheduled callback.
the callback function, it must reschedule itself to maintain 'chain of callbacks'
Generated using TypeDoc