Timers

Node.js timers module — scheduling callbacks for future execution.

These functions are also available as globals on globalThis, matching browser and Node.js behavior.

Module: node:timers Support: Experimental Since: 1.1.0 Docs: Node.js Docs See also: https://nodejs.org/api/timers.html

Static Methods

🟢 setTimeout(callback, delay, args)
Schedules a callback to be invoked once after `delay` milliseconds.
🟢 clearTimeout(id)
Cancels a timeout previously established by setTimeout().
🟢 setInterval(callback, delay, args)
Schedules a callback to be invoked repeatedly every `delay` milliseconds.
🟢 clearInterval(id)
Cancels an interval previously established by setInterval().
🟢 setImmediate(callback, args)
Schedules a callback to be invoked asynchronously "immediately" (after
🟢 clearImmediate(id)
Cancels an immediate action previously established by setImmediate().