Skip to content

Commit b4d45ba

Browse files
committed
fixup! process: implement process.hrtime.bigint()
1 parent 30533c7 commit b4d45ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/api/process.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,9 @@ added: v0.7.6
11591159
* `time` {integer[]} The result of a previous call to `process.hrtime()`
11601160
* Returns: {integer[]}
11611161

1162+
This is the legacy version of [`process.hrtime.bigint()`][]
1163+
before `bigint` was introduced in JavaScript.
1164+
11621165
The `process.hrtime()` method returns the current high-resolution real time
11631166
in a `[seconds, nanoseconds]` tuple `Array`, where `nanoseconds` is the
11641167
remaining part of the real time that can't be represented in second precision.
@@ -1199,7 +1202,7 @@ current high-resolution real time in a `bigint`.
11991202

12001203
Unlike [`process.hrtime()`][], it does not support an additional `time`
12011204
argument since the difference can just be computed directly
1202-
by substraction of the two `bigint`s.
1205+
by subtraction of the two `bigint`s.
12031206

12041207
```js
12051208
const start = process.hrtime.bigint();
@@ -1210,7 +1213,7 @@ setTimeout(() => {
12101213
// 191052633396993n
12111214

12121215
console.log(`Benchmark took ${end - start} nanoseconds`);
1213-
// benchmark took 1154389282 nanoseconds
1216+
// Benchmark took 1154389282 nanoseconds
12141217
}, 1000);
12151218
```
12161219

@@ -2058,6 +2061,7 @@ cases:
20582061
[`process.exit()`]: #process_process_exit_code
20592062
[`process.exitCode`]: #process_process_exitcode
20602063
[`process.hrtime()`]: #process_process_hrtime_time
2064+
[`process.hrtime.bigint()`]: #process_process_hrtime_bigint
20612065
[`process.kill()`]: #process_process_kill_pid_signal
20622066
[`process.setUncaughtExceptionCaptureCallback()`]: process.html#process_process_setuncaughtexceptioncapturecallback_fn
20632067
[`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch

0 commit comments

Comments
 (0)