@@ -7,43 +7,44 @@ this module in order to use them.
7
7
8
8
## clearImmediate(immediateObject)
9
9
10
- Stops an immediate from triggering.
10
+ Stops an ` immediateObject ` , as created by [ ` setImmediate ` ] [ ] , from triggering.
11
11
12
12
## clearInterval(intervalObject)
13
13
14
- Stops an interval from triggering.
14
+ Stops an ` intervalObject ` , as created by [ ` setInterval ` ] [ ] , from triggering.
15
15
16
16
## clearTimeout(timeoutObject)
17
17
18
- Prevents a timeout from triggering.
18
+ Prevents a ` timeoutObject ` , as created by [ ` setTimeout ` ] [ ] , from triggering.
19
19
20
20
## ref()
21
21
22
- If you had previously ` unref() ` d a timer you can call ` ref() ` to explicitly
22
+ If a timer was previously ` unref() ` d, then ` ref() ` can be called to explicitly
23
23
request the timer hold the program open. If the timer is already ` ref ` d calling
24
24
` ref ` again will have no effect.
25
25
26
26
Returns the timer.
27
27
28
28
## setImmediate(callback[ , arg] [ , ... ] )
29
29
30
- To schedule the "immediate" execution of ` callback ` after I/O events
31
- callbacks and before [ ` setTimeout ` ] [ ] and [ ` setInterval ` ] [ ] . Returns an
32
- ` immediateObject ` for possible use with ` clearImmediate() ` . Optionally you
33
- can also pass arguments to the callback.
30
+ To schedule the "immediate" execution of ` callback ` after I/O events'
31
+ callbacks and before timers set by [ ` setTimeout ` ] [ ] and [ ` setInterval ` ] [ ] are
32
+ triggered. Returns an ` immediateObject ` for possible use with
33
+ [ ` clearImmediate ` ] [ ] . Additional optional arguments may be passed to the
34
+ callback.
34
35
35
36
Callbacks for immediates are queued in the order in which they were created.
36
- The entire callback queue is processed every event loop iteration. If you queue
37
- an immediate from inside an executing callback, that immediate won't fire
37
+ The entire callback queue is processed every event loop iteration. If an
38
+ immediate is queued from inside an executing callback, that immediate won't fire
38
39
until the next event loop iteration.
39
40
40
41
If ` callback ` is not a function ` setImmediate() ` will throw immediately.
41
42
42
43
## setInterval(callback, delay[ , arg] [ , ... ] )
43
44
44
45
To schedule the repeated execution of ` callback ` every ` delay ` milliseconds.
45
- Returns a ` intervalObject ` for possible use with ` clearInterval() ` . Optionally
46
- you can also pass arguments to the callback.
46
+ Returns a ` intervalObject ` for possible use with [ ` clearInterval ` ] [ ] . Additional
47
+ optional arguments may be passed to the callback.
47
48
48
49
To follow browser behavior, when using delays larger than 2147483647
49
50
milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
@@ -54,8 +55,8 @@ If `callback` is not a function `setInterval()` will throw immediately.
54
55
## setTimeout(callback, delay[ , arg] [ , ... ] )
55
56
56
57
To schedule execution of a one-time ` callback ` after ` delay ` milliseconds.
57
- Returns a ` timeoutObject ` for possible use with ` clearTimeout() ` . Optionally you
58
- can also pass arguments to the callback.
58
+ Returns a ` timeoutObject ` for possible use with [ ` clearTimeout ` ] [ ] . Additional
59
+ optional arguments may be passed to the callback.
59
60
60
61
The callback will likely not be invoked in precisely ` delay ` milliseconds.
61
62
Node.js makes no guarantees about the exact timing of when callbacks will fire,
@@ -71,16 +72,20 @@ If `callback` is not a function `setTimeout()` will throw immediately.
71
72
## unref()
72
73
73
74
The opaque value returned by [ ` setTimeout ` ] [ ] and [ ` setInterval ` ] [ ] also has the
74
- method ` timer.unref() ` which will allow you to create a timer that is active but
75
+ method ` timer.unref() ` which allows the creation of a timer that is active but
75
76
if it is the only item left in the event loop, it won't keep the program
76
77
running. If the timer is already ` unref ` d calling ` unref ` again will have no
77
78
effect.
78
79
79
- In the case of ` setTimeout ` when you ` unref ` you create a separate timer that
80
- will wakeup the event loop, creating too many of these may adversely effect
81
- event loop performance -- use wisely.
80
+ In the case of [ ` setTimeout ` ] [ ] , ` unref ` creates a separate timer that will
81
+ wakeup the event loop, creating too many of these may adversely effect event
82
+ loop performance -- use wisely.
82
83
83
84
Returns the timer.
84
85
86
+ [ `clearImmediate` ] : timers.html#timers_clearimmediate_immediateobject
87
+ [ `clearInterval` ] : timers.html#timers_clearinterval_intervalobject
88
+ [ `clearTimeout` ] : timers.html#timers_cleartimeout_timeoutobject
89
+ [ `setImmediate` ] : timers.html#timers_setimmediate_callback_arg
85
90
[ `setInterval` ] : timers.html#timers_setinterval_callback_delay_arg
86
91
[ `setTimeout` ] : timers.html#timers_settimeout_callback_delay_arg
0 commit comments