Usage in Deno
import * as mod from "node:timers";
The timer
module exposes a global API for scheduling functions to
be called at some future period of time. Because the timer functions are
globals, there is no need to call require('node:timers')
to use the API.
The timer functions within Node.js implement a similar API as the timers API provided by Web Browsers but use a different internal implementation that is built around the Node.js Event Loop.
This object is created internally and is returned from setImmediate()
. It
can be passed to clearImmediate()
in order to cancel the scheduled
actions.
This object is created internally and is returned from setTimeout()
and setInterval()
. It can be passed to either clearTimeout()
or clearInterval()
in order to cancel the
scheduled actions.
Cancels an Immediate
object created by setImmediate()
.
Cancels a Timeout
object created by setInterval()
.
Cancels a Timeout
object created by setTimeout()
.
Schedules the "immediate" execution of the callback
after I/O events'
callbacks.
Schedules repeated execution of callback
every delay
milliseconds.
Schedules execution of a one-time callback
after delay
milliseconds.