Timers

setImmediate()

Schedules a callback in the check phase, after poll in the event-loop model.

Formal Syntax & Structure

nodejs syntaxnodejs
setImmediate(callback[, ...args])

Parameters & Attributes

NameTypeDescription
callbackFunctionFunction to run.
argsanyCallback arguments.

Return Value

Immediate

Handle usable with clearImmediate.

Working Example

Example Snippetnodejs
setImmediate(console.log,'later'); console.log('now');
Node.js Reference