Browse Source

doc: add `added:` information for timers

Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7493
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v7.x
Anna Henningsen 9 years ago
parent
commit
cd4dbf3348
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 24
      doc/api/timers.md

24
doc/api/timers.md

@ -29,6 +29,9 @@ export both `timeout.ref()` and `timeout.unref()` functions that can be used to
control this default behavior. control this default behavior.
### timeout.ref() ### timeout.ref()
<!-- YAML
added: v0.9.1
-->
When called, requests that the Node.js event loop *not* exit so long as the When called, requests that the Node.js event loop *not* exit so long as the
`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
@ -40,6 +43,9 @@ previously.
Returns a reference to the `Timeout`. Returns a reference to the `Timeout`.
### timeout.unref() ### timeout.unref()
<!-- YAML
added: v0.9.1
-->
When called, the active `Timeout` object will not require the Node.js event loop When called, the active `Timeout` object will not require the Node.js event loop
to remain active. If there is no other activity keeping the event loop running, to remain active. If there is no other activity keeping the event loop running,
@ -60,6 +66,9 @@ which method was used to create the timer and what other work the Node.js
event loop is doing. event loop is doing.
### setImmediate(callback[, ...arg]) ### setImmediate(callback[, ...arg])
<!-- YAML
added: v0.9.1
-->
* `callback` {Function} The function to call at the end of this turn of * `callback` {Function} The function to call at the end of this turn of
[the Node.js Event Loop] [the Node.js Event Loop]
@ -79,6 +88,9 @@ next event loop iteration.
If `callback` is not a function, a [`TypeError`][] will be thrown. If `callback` is not a function, a [`TypeError`][] will be thrown.
### setInterval(callback, delay[, ...arg]) ### setInterval(callback, delay[, ...arg])
<!-- YAML
added: v0.0.1
-->
* `callback` {Function} The function to call when the timer elapses. * `callback` {Function} The function to call when the timer elapses.
* `delay` {number} The number of milliseconds to wait before calling the * `delay` {number} The number of milliseconds to wait before calling the
@ -94,6 +106,9 @@ set to `1`.
If `callback` is not a function, a [`TypeError`][] will be thrown. If `callback` is not a function, a [`TypeError`][] will be thrown.
### setTimeout(callback, delay[, ...arg]) ### setTimeout(callback, delay[, ...arg])
<!-- YAML
added: v0.0.1
-->
* `callback` {Function} The function to call when the timer elapses. * `callback` {Function} The function to call when the timer elapses.
* `delay` {number} The number of milliseconds to wait before calling the * `delay` {number} The number of milliseconds to wait before calling the
@ -120,6 +135,9 @@ each return objects that represent the scheduled timers. These can be used to
cancel the timer and prevent it from triggering. cancel the timer and prevent it from triggering.
### clearImmediate(immediate) ### clearImmediate(immediate)
<!-- YAML
added: v0.9.1
-->
* `immediate` {Immediate} An `Immediate` object as returned by * `immediate` {Immediate} An `Immediate` object as returned by
[`setImmediate()`][]. [`setImmediate()`][].
@ -127,12 +145,18 @@ cancel the timer and prevent it from triggering.
Cancels an `Immediate` object created by [`setImmediate()`][]. Cancels an `Immediate` object created by [`setImmediate()`][].
### clearInterval(timeout) ### clearInterval(timeout)
<!-- YAML
added: v0.0.1
-->
* `timeout` {Timeout} A `Timeout` object as returned by [`setInterval()`][]. * `timeout` {Timeout} A `Timeout` object as returned by [`setInterval()`][].
Cancels a `Timeout` object created by [`setInterval()`][]. Cancels a `Timeout` object created by [`setInterval()`][].
### clearTimeout(timeout) ### clearTimeout(timeout)
<!-- YAML
added: v0.0.1
-->
* `timeout` {Timeout} A `Timeout` object as returned by [`setTimeout()`][]. * `timeout` {Timeout} A `Timeout` object as returned by [`setTimeout()`][].

Loading…
Cancel
Save