5
5
All of the timer functions are globals. You do not need to ` require() `
6
6
this module in order to use them.
7
7
8
- ## setTimeout(callback, delay [ , arg ] [ , ... ] )
8
+ ## clearImmediate(immediateObject )
9
9
10
- To schedule execution of a one-time ` callback ` after ` delay ` milliseconds. Returns a
11
- ` timeoutObject ` for possible use with ` clearTimeout() ` . Optionally you can
12
- also pass arguments to the callback.
10
+ Stops an immediate from triggering.
13
11
14
- It is important to note that your callback will probably not be called in exactly
15
- ` delay ` milliseconds - Node.js makes no guarantees about the exact timing of when
16
- the callback will fire, nor of the ordering things will fire in. The callback will
17
- be called as close as possible to the time specified.
12
+ ## clearInterval(intervalObject)
18
13
19
- To follow browser behavior, when using delays larger than 2147483647
20
- milliseconds (approximately 25 days) or less than 1, the timeout is executed
21
- immediately, as if the ` delay ` was set to 1.
14
+ Stops an interval from triggering.
22
15
23
16
## clearTimeout(timeoutObject)
24
17
25
18
Prevents a timeout from triggering.
26
19
20
+ ## ref()
21
+
22
+ If you had previously ` unref() ` d a timer you can call ` ref() ` to explicitly
23
+ request the timer hold the program open. If the timer is already ` ref ` d calling
24
+ ` ref ` again will have no effect.
25
+
26
+ Returns the timer.
27
+
28
+ ## setImmediate(callback[ , arg] [ , ... ] )
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.
34
+
35
+ 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
38
+ until the next event loop iteration.
39
+
27
40
## setInterval(callback, delay[ , arg] [ , ... ] )
28
41
29
42
To schedule the repeated execution of ` callback ` every ` delay ` milliseconds.
@@ -34,9 +47,20 @@ To follow browser behavior, when using delays larger than 2147483647
34
47
milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the
35
48
` delay ` .
36
49
37
- ## clearInterval(intervalObject )
50
+ ## setTimeout(callback, delay [ , arg ] [ , ... ] )
38
51
39
- Stops an interval from triggering.
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.
55
+
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.
60
+
61
+ To follow browser behavior, when using delays larger than 2147483647
62
+ milliseconds (approximately 25 days) or less than 1, the timeout is executed
63
+ immediately, as if the ` delay ` was set to 1.
40
64
41
65
## unref()
42
66
@@ -50,27 +74,3 @@ will wakeup the event loop, creating too many of these may adversely effect
50
74
event loop performance -- use wisely.
51
75
52
76
Returns the timer.
53
-
54
- ## ref()
55
-
56
- If you had previously ` unref() ` d a timer you can call ` ref() ` to explicitly
57
- request the timer hold the program open. If the timer is already ` ref ` d calling
58
- ` ref ` again will have no effect.
59
-
60
- Returns the timer.
61
-
62
- ## setImmediate(callback[ , arg] [ , ... ] )
63
-
64
- To schedule the "immediate" execution of ` callback ` after I/O events
65
- callbacks and before ` setTimeout ` and ` setInterval ` . Returns an
66
- ` immediateObject ` for possible use with ` clearImmediate() ` . Optionally you
67
- can also pass arguments to the callback.
68
-
69
- Callbacks for immediates are queued in the order in which they were created.
70
- The entire callback queue is processed every event loop iteration. If you queue
71
- an immediate from inside an executing callback, that immediate won't fire
72
- until the next event loop iteration.
73
-
74
- ## clearImmediate(immediateObject)
75
-
76
- Stops an immediate from triggering.
0 commit comments