Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7fd8f13

Browse filesBrowse files
siteguirvagg
authored andcommitted
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: #3512 Reviewed-By: Trevor Norris <trev.norris@gmai.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 5977963 commit 7fd8f13
Copy full SHA for 7fd8f13

File tree

Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/timers.markdown‎

Copy file name to clipboardExpand all lines: doc/api/timers.markdown
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ It is important to note that your callback will probably not be called in exactl
1616
the callback will fire, nor of the ordering things will fire in. The callback will
1717
be called as close as possible to the time specified.
1818

19+
To follow browser behavior, when using delays larger than 2147483647
20+
milliseconds (approximately 25 days) or less than 1, the timeout is executed
21+
immediately, as if the `delay` was set to 1.
22+
1923
## clearTimeout(timeoutObject)
2024

2125
Prevents a timeout from triggering.
@@ -26,6 +30,10 @@ To schedule the repeated execution of `callback` every `delay` milliseconds.
2630
Returns a `intervalObject` for possible use with `clearInterval()`. Optionally
2731
you can also pass arguments to the callback.
2832

33+
To follow browser behavior, when using delays larger than 2147483647
34+
milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
35+
`delay`.
36+
2937
## clearInterval(intervalObject)
3038

3139
Stops an interval from triggering.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.