Skip to content
Permalink
Browse files

doc,timers: use code markup/markdown in headers

PR-URL: #31086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
Trott authored and BridgeAR committed Dec 24, 2019
1 parent cf563bb commit 450d9a27bf883392d7193da95f10c1c57acfe473
Showing with 15 additions and 15 deletions.
  1. +15 −15 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()`
<!-- YAML
added: v11.0.0
-->
@@ -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()`
<!-- YAML
added: v9.7.0
-->
@@ -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()`
<!-- YAML
added: v9.7.0
-->
@@ -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()`
<!-- YAML
added: v11.0.0
-->
@@ -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()`
<!-- YAML
added: v0.9.1
-->
@@ -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()`
<!-- YAML
added: v10.2.0
-->
@@ -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()`
<!-- YAML
added: v0.9.1
-->
@@ -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])`
<!-- YAML
added: v0.9.1
-->
@@ -172,7 +172,7 @@ async function timerExample() {
timerExample();
```

### setInterval(callback, delay\[, ...args\])
### `setInterval(callback, delay[, ...args])`
<!-- YAML
added: v0.0.1
-->
@@ -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])`
<!-- YAML
added: v0.0.1
-->
@@ -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)`
<!-- YAML
added: v0.9.1
-->
@@ -245,7 +245,7 @@ added: v0.9.1

Cancels an `Immediate` object created by [`setImmediate()`][].

### clearInterval(timeout)
### `clearInterval(timeout)`
<!-- YAML
added: v0.0.1
-->
@@ -254,7 +254,7 @@ added: v0.0.1

Cancels a `Timeout` object created by [`setInterval()`][].

### clearTimeout(timeout)
### `clearTimeout(timeout)`
<!-- YAML
added: v0.0.1
-->

0 comments on commit 450d9a2

Please sign in to comment.
You can’t perform that action at this time.