Timers
setTimeout()
Schedules a one-shot callback after a delay threshold. Timing and order are not exact guarantees.
Formal Syntax & Structure
nodejs syntaxnodejs
setTimeout(callback[, delay[, ...args]])Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| callback | Function | Function to run. |
| delay | number | Delay in milliseconds; default 1. |
| args | any | Callback arguments. |
Return Value
Timeout
Handle usable with clearTimeout.
Working Example
Example Snippetnodejs
setTimeout(console.log,1,'ready');