Skip to content

Commit 393e569

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
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 <[email protected]> Reviewed-By: jasnell - James M Snell <[email protected]> Reviewed-By: Stephan Belanger <[email protected]>
1 parent e2a682e commit 393e569

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

doc/api/timers.markdown

+12-11
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)