Skip to content

Commit 6585b16

Browse files
puzpuzpuzdanielleadams
authored andcommitted
doc: improve eventLoopUtilization documentation
PR-URL: #35479 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Harshitha K P <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]>
1 parent 0ac5fa7 commit 6585b16

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

doc/api/perf_hooks.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ Performance Timeline. If `name` is provided, removes only the named mark.
5858
added: v14.10.0
5959
-->
6060

61-
* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()`
62-
* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()`
63-
prior to `util1`
61+
* `utilization1` {Object} The result of a previous call to
62+
`eventLoopUtilization()`.
63+
* `utilization2` {Object} The result of a previous call to
64+
`eventLoopUtilization()` prior to `utilization1`.
6465
* Returns {Object}
6566
* `idle` {number}
6667
* `active` {number}
@@ -70,9 +71,9 @@ The `eventLoopUtilization()` method returns an object that contains the
7071
cumulative duration of time the event loop has been both idle and active as a
7172
high resolution milliseconds timer. The `utilization` value is the calculated
7273
Event Loop Utilization (ELU). If bootstrapping has not yet finished, the
73-
properties have the value of 0.
74+
properties have the value of `0`.
7475

75-
`utilization1` and `utilization2` are optional parameters.
76+
Both `utilization1` and `utilization2` are optional parameters.
7677

7778
If `utilization1` is passed, then the delta between the current call's `active`
7879
and `idle` times, as well as the corresponding `utilization` value are
@@ -102,8 +103,8 @@ setImmediate(() => {
102103
```
103104

104105
Although the CPU is mostly idle while running this script, the value of
105-
`utilization` is 1. This is because the call to [`child_process.spawnSync()`][]
106-
blocks the event loop from proceeding.
106+
`utilization` is `1`. This is because the call to
107+
[`child_process.spawnSync()`][] blocks the event loop from proceeding.
107108

108109
Passing in a user-defined object instead of the result of a previous call to
109110
`eventLoopUtilization()` will lead to undefined behavior. The return values

0 commit comments

Comments
 (0)