@@ -7,41 +7,42 @@ 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
## setInterval(callback, delay[ , arg] [ , ... ] )
41
42
42
43
To schedule the repeated execution of ` callback ` every ` delay ` milliseconds.
43
- Returns a ` intervalObject ` for possible use with ` clearInterval() ` . Optionally
44
- you can also pass arguments to the callback.
44
+ Returns a ` intervalObject ` for possible use with [ ` clearInterval ` ] [ ] . Additional
45
+ optional arguments may be passed to the callback.
45
46
46
47
To follow browser behavior, when using delays larger than 2147483647
47
48
milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
@@ -50,8 +51,8 @@ milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
50
51
## setTimeout(callback, delay[ , arg] [ , ... ] )
51
52
52
53
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.
54
+ Returns a ` timeoutObject ` for possible use with [ ` clearTimeout ` ] [ ] . Additional
55
+ optional arguments may be passed to the callback.
55
56
56
57
The callback will likely not be invoked in precisely ` delay ` milliseconds.
57
58
Node.js makes no guarantees about the exact timing of when callbacks will fire,
@@ -65,16 +66,20 @@ immediately, as if the `delay` was set to 1.
65
66
## unref()
66
67
67
68
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
+ method ` timer.unref() ` which allows the creation of a timer that is active but
69
70
if it is the only item left in the event loop, it won't keep the program
70
71
running. If the timer is already ` unref ` d calling ` unref ` again will have no
71
72
effect.
72
73
73
- In the case of ` setTimeout ` when you ` unref ` you create a separate timer that
74
- will wakeup the event loop, creating too many of these may adversely effect
75
- event loop performance -- use wisely.
74
+ In the case of [ ` setTimeout ` ] [ ] , ` unref ` creates a separate timer that will
75
+ wakeup the event loop, creating too many of these may adversely effect event
76
+ loop performance -- use wisely.
76
77
77
78
Returns the timer.
78
79
80
+ [ `clearImmediate` ] : timers.html#timers_clearimmediate_immediateobject
81
+ [ `clearInterval` ] : timers.html#timers_clearinterval_intervalobject
82
+ [ `clearTimeout` ] : timers.html#timers_cleartimeout_timeoutobject
83
+ [ `setImmediate` ] : timers.html#timers_setimmediate_callback_arg
79
84
[ `setInterval` ] : timers.html#timers_setinterval_callback_delay_arg
80
85
[ `setTimeout` ] : timers.html#timers_settimeout_callback_delay_arg
0 commit comments