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 393e569

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
doc: copyedit setTimeout() documentation
Copyedit the documentation for setTimeout() and enforce wrapping at 80 characters in the markdown file for nearby text. PR-URL: #4434 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
1 parent e2a682e commit 393e569
Copy full SHA for 393e569

File tree

Expand file treeCollapse file tree

1 file changed

+12
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-11
lines changed
Open diff view settings
Collapse file

‎doc/api/timers.markdown‎

Copy file name to clipboardExpand all lines: doc/api/timers.markdown
+12-11Lines changed: 12 additions & 11 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,26 @@ milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
4949

5050
## setTimeout(callback, delay[, arg][, ...])
5151

52-
To schedule execution of a one-time `callback` after `delay` milliseconds. Returns a
53-
`timeoutObject` for possible use with `clearTimeout()`. Optionally you can
54-
also pass arguments to the callback.
52+
To schedule execution of a one-time `callback` after `delay` milliseconds.
53+
Returns a `timeoutObject` for possible use with `clearTimeout()`. Optionally you
54+
can also pass arguments to the callback.
5555

56-
It is important to note that your callback will probably not be called in exactly
57-
`delay` milliseconds - Node.js makes no guarantees about the exact timing of when
58-
the callback will fire, nor of the ordering things will fire in. The callback will
59-
be called as close as possible to the time specified.
56+
The callback will likely not be invoked in precisely `delay` milliseconds.
57+
Node.js makes no guarantees about the exact timing of when callbacks will fire,
58+
nor of their ordering. The callback will be called as close as possible to the
59+
time specified.
6060

6161
To follow browser behavior, when using delays larger than 2147483647
6262
milliseconds (approximately 25 days) or less than 1, the timeout is executed
6363
immediately, as if the `delay` was set to 1.
6464

6565
## unref()
6666

67-
The opaque value returned by [`setTimeout`][] and [`setInterval`][] also has the method
68-
`timer.unref()` which will allow you to create a timer that is active but if
69-
it is the only item left in the event loop, it won't keep the program running.
70-
If the timer is already `unref`d calling `unref` again will have no effect.
67+
The opaque value returned by [`setTimeout`][] and [`setInterval`][] also has the
68+
method `timer.unref()` which will allow you to create a timer that is active but
69+
if it is the only item left in the event loop, it won't keep the program
70+
running. If the timer is already `unref`d calling `unref` again will have no
71+
effect.
7172

7273
In the case of `setTimeout` when you `unref` you create a separate timer that
7374
will wakeup the event loop, creating too many of these may adversely effect

0 commit comments

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