Skip to main content
timers - Node documentation

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 import 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.

Classes

c
Immediate

This object is created internally and is returned from setImmediate(). It can be passed to clearImmediate() in order to cancel the scheduled actions.

c
Timeout

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.

Functions

f
queueMicrotask
No documentation available

Interfaces

I
Timer
No documentation available
I
TimerOptions
No documentation available

Variables

f
v
clearImmediate

Cancels an Immediate object created by setImmediate().

f
v
clearInterval

Cancels a Timeout object created by setInterval().

f
v
clearTimeout

Cancels a Timeout object created by setTimeout().

f
N
v
setImmediate

Schedules the "immediate" execution of the callback after I/O events' callbacks.

v
setImmediate.__promisify__
No documentation available
f
N
v
setInterval

Schedules repeated execution of callback every delay milliseconds.

v
setInterval.__promisify__
No documentation available
f
N
v
setTimeout

Schedules execution of a one-time callback after delay milliseconds.

v
setTimeout.__promisify__
No documentation available
Back to top