timers
The timers
module provides access to web-like timing functionality.
API Reference
Functions
setTimeout(callback, ms)
Schedules callback
to be called in ms
milliseconds. Any additional
arguments are passed straight through to the callback.
Function to be called.
Interval in milliseconds after which the function will be called.
An ID that can later be used to undo this scheduling, if callback
hasn't yet
been called.
clearTimeout(ID)
Given an ID returned from setTimeout()
, prevents the callback with the ID
from being called (if it hasn't yet been called).
An ID returned from setTimeout()
.
setInterval(callback, ms)
Schedules callback
to be called repeatedly every ms
milliseconds. Any
additional arguments are passed straight through to the callback.
Function to be called.
Interval in milliseconds at which the function will be called.
An ID that can later be used to unschedule the callback.
clearInterval(ID)
Given an ID returned from setInterval()
, prevents the callback with the ID
from being called again.
An ID returned from setInterval()
.