doc: add note about timeout delay > TIMEOUT_MAX
When setTimeout() and setInterval() are called with `delay` greater than TIMEOUT_MAX (2147483647), the supplied value is ignored and 1 is used instead. Add a note about this in the timers docs. PR-URL: https://github.com/nodejs/node/pull/3512 Reviewed-By: Trevor Norris <trev.norris@gmai.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
f6230b9b72
commit
ac7dd5fc6c
@ -16,6 +16,10 @@ It is important to note that your callback will probably not be called in exactl
|
||||
the callback will fire, nor of the ordering things will fire in. The callback will
|
||||
be called as close as possible to the time specified.
|
||||
|
||||
To follow browser behavior, when using delays larger than 2147483647
|
||||
milliseconds (approximately 25 days) or less than 1, the timeout is executed
|
||||
immediately, as if the `delay` was set to 1.
|
||||
|
||||
## clearTimeout(timeoutObject)
|
||||
|
||||
Prevents a timeout from triggering.
|
||||
@ -26,6 +30,10 @@ To schedule the repeated execution of `callback` every `delay` milliseconds.
|
||||
Returns a `intervalObject` for possible use with `clearInterval()`. Optionally
|
||||
you can also pass arguments to the callback.
|
||||
|
||||
To follow browser behavior, when using delays larger than 2147483647
|
||||
milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
|
||||
`delay`.
|
||||
|
||||
## clearInterval(intervalObject)
|
||||
|
||||
Stops an interval from triggering.
|
||||
|
Loading…
x
Reference in New Issue
Block a user