{ "source": "doc/api/timers.markdown", "modules": [ { "textRaw": "Timers", "name": "timers", "stability": 5, "stabilityText": "Locked", "desc": "

All of the timer functions are globals. You do not need to require()\nthis module in order to use them.\n\n

\n", "methods": [ { "textRaw": "setTimeout(callback, delay, [arg], [...])", "type": "method", "name": "setTimeout", "desc": "

To schedule execution of a one-time callback after delay milliseconds. Returns a\ntimeoutId for possible use with clearTimeout(). Optionally you can\nalso pass arguments to the callback.\n\n

\n

It is important to note that your callback will probably not be called in exactly\ndelay milliseconds - Node.js makes no guarantees about the exact timing of when\nthe callback will fire, nor of the ordering things will fire in. The callback will\nbe called as close as possible to the time specified.\n\n

\n", "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "arg", "optional": true }, { "name": "...", "optional": true } ] } ] }, { "textRaw": "clearTimeout(timeoutId)", "type": "method", "name": "clearTimeout", "desc": "

Prevents a timeout from triggering.\n\n

\n", "signatures": [ { "params": [ { "name": "timeoutId" } ] } ] }, { "textRaw": "setInterval(callback, delay, [arg], [...])", "type": "method", "name": "setInterval", "desc": "

To schedule the repeated execution of callback every delay milliseconds.\nReturns a intervalId for possible use with clearInterval(). Optionally\nyou can also pass arguments to the callback.\n\n

\n", "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "arg", "optional": true }, { "name": "...", "optional": true } ] } ] }, { "textRaw": "clearInterval(intervalId)", "type": "method", "name": "clearInterval", "desc": "

Stops a interval from triggering.\n

\n", "signatures": [ { "params": [ { "name": "intervalId" } ] } ] } ], "type": "module", "displayName": "Timers" } ] }