diff options
author | Rich Trott <rtrott@gmail.com> | 2015-12-26 18:39:16 -0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2015-12-29 19:13:13 -0800 |
commit | f241d6685b6d63e2170040b37a064e0d502847b7 (patch) | |
tree | 3ebc72a646bc181b94b97865b40841e479b27a12 /doc | |
parent | 11136bf334cc22c34f7b5969f33d0b9f37342754 (diff) | |
download | android-node-v8-f241d6685b6d63e2170040b37a064e0d502847b7.tar.gz android-node-v8-f241d6685b6d63e2170040b37a064e0d502847b7.tar.bz2 android-node-v8-f241d6685b6d63e2170040b37a064e0d502847b7.zip |
doc: copyedit setTimeout() documentation
Copyedit the documentation for setTimeout() and enforce wrapping at 80
characters in the markdown file for nearby text.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/timers.markdown | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index 4d5caf2e0e..cf2f24ae93 100644 --- a/doc/api/timers.markdown +++ b/doc/api/timers.markdown @@ -49,14 +49,14 @@ milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the ## setTimeout(callback, delay[, arg][, ...]) -To schedule execution of a one-time `callback` after `delay` milliseconds. Returns a -`timeoutObject` for possible use with `clearTimeout()`. Optionally you can -also pass arguments to the callback. +To schedule execution of a one-time `callback` after `delay` milliseconds. +Returns a `timeoutObject` for possible use with `clearTimeout()`. Optionally you +can also pass arguments to the callback. -It is important to note that your callback will probably not be called in exactly -`delay` milliseconds - Node.js makes no guarantees about the exact timing of when -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. +The callback will likely not be invoked in precisely `delay` milliseconds. +Node.js makes no guarantees about the exact timing of when callbacks will fire, +nor of their ordering. 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 @@ -64,10 +64,11 @@ immediately, as if the `delay` was set to 1. ## unref() -The opaque value returned by [`setTimeout`][] and [`setInterval`][] also has the method -`timer.unref()` which will allow you to create a timer that is active but if -it is the only item left in the event loop, it won't keep the program running. -If the timer is already `unref`d calling `unref` again will have no effect. +The opaque value returned by [`setTimeout`][] and [`setInterval`][] also has the +method `timer.unref()` which will allow you to create a timer that is active but +if it is the only item left in the event loop, it won't keep the program +running. If the timer is already `unref`d calling `unref` again will have no +effect. In the case of `setTimeout` when you `unref` you create a separate timer that will wakeup the event loop, creating too many of these may adversely effect |