diff --git a/doc/api/timers.md b/doc/api/timers.md index 646c0abd1cbd24..a312022791f54b 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -12,7 +12,7 @@ The timer functions within Node.js implement a similar API as the timers API provided by Web Browsers but use a different internal implementation that is built around the Node.js [Event Loop][]. -## Class: Immediate +## Class: `Immediate` This object is created internally and is returned from [`setImmediate()`][]. It can be passed to [`clearImmediate()`][] in order to cancel the scheduled @@ -23,7 +23,7 @@ running as long as the immediate is active. The `Immediate` object returned by [`setImmediate()`][] exports both `immediate.ref()` and `immediate.unref()` functions that can be used to control this default behavior. -### immediate.hasRef() +### `immediate.hasRef()` @@ -32,7 +32,7 @@ added: v11.0.0 If true, the `Immediate` object will keep the Node.js event loop active. -### immediate.ref() +### `immediate.ref()` @@ -46,7 +46,7 @@ effect. By default, all `Immediate` objects are "ref'ed", making it normally unnecessary to call `immediate.ref()` unless `immediate.unref()` had been called previously. -### immediate.unref() +### `immediate.unref()` @@ -58,7 +58,7 @@ loop to remain active. If there is no other activity keeping the event loop running, the process may exit before the `Immediate` object's callback is invoked. Calling `immediate.unref()` multiple times will have no effect. -## Class: Timeout +## Class: `Timeout` This object is created internally and is returned from [`setTimeout()`][] and [`setInterval()`][]. It can be passed to either [`clearTimeout()`][] or @@ -70,7 +70,7 @@ timer is active. Each of the `Timeout` objects returned by these functions export both `timeout.ref()` and `timeout.unref()` functions that can be used to control this default behavior. -### timeout.hasRef() +### `timeout.hasRef()` @@ -79,7 +79,7 @@ added: v11.0.0 If true, the `Timeout` object will keep the Node.js event loop active. -### timeout.ref() +### `timeout.ref()` @@ -92,7 +92,7 @@ When called, requests that the Node.js event loop *not* exit so long as the By default, all `Timeout` objects are "ref'ed", making it normally unnecessary to call `timeout.ref()` unless `timeout.unref()` had been called previously. -### timeout.refresh() +### `timeout.refresh()` @@ -107,7 +107,7 @@ JavaScript object. Using this on a timer that has already called its callback will reactivate the timer. -### timeout.unref() +### `timeout.unref()` @@ -130,7 +130,7 @@ a certain period of time. When a timer's function is called varies depending on which method was used to create the timer and what other work the Node.js event loop is doing. -### setImmediate(callback\[, ...args\]) +### `setImmediate(callback[, ...args])` @@ -172,7 +172,7 @@ async function timerExample() { timerExample(); ``` -### setInterval(callback, delay\[, ...args\]) +### `setInterval(callback, delay[, ...args])` @@ -190,7 +190,7 @@ set to `1`. Non-integer delays are truncated to an integer. If `callback` is not a function, a [`TypeError`][] will be thrown. -### setTimeout(callback, delay\[, ...args\]) +### `setTimeout(callback, delay[, ...args])` @@ -235,7 +235,7 @@ cancel the timer and prevent it from triggering. It is not possible to cancel timers that were created using the promisified variants of [`setImmediate()`][], [`setTimeout()`][]. -### clearImmediate(immediate) +### `clearImmediate(immediate)` @@ -245,7 +245,7 @@ added: v0.9.1 Cancels an `Immediate` object created by [`setImmediate()`][]. -### clearInterval(timeout) +### `clearInterval(timeout)` @@ -254,7 +254,7 @@ added: v0.0.1 Cancels a `Timeout` object created by [`setInterval()`][]. -### clearTimeout(timeout) +### `clearTimeout(timeout)`