@@ -1163,6 +1163,9 @@ added: v0.7.6
11631163* ` time ` {integer[ ] } The result of a previous call to ` process.hrtime() `
11641164* Returns: {integer[ ] }
11651165
1166+ This is the legacy version of [ ` process.hrtime.bigint() ` ] [ ]
1167+ before ` bigint ` was introduced in JavaScript.
1168+
11661169The ` process.hrtime() ` method returns the current high-resolution real time
11671170in a ` [seconds, nanoseconds] ` tuple ` Array ` , where ` nanoseconds ` is the
11681171remaining part of the real time that can't be represented in second precision.
@@ -1191,6 +1194,33 @@ setTimeout(() => {
11911194}, 1000 );
11921195```
11931196
1197+ ## process.hrtime.bigint()
1198+ <!-- YAML
1199+ added: REPLACEME
1200+ -->
1201+
1202+ * Returns: {bigint}
1203+
1204+ The ` bigint ` version of the [ ` process.hrtime() ` ] [ ] method returning the
1205+ current high-resolution real time in a ` bigint ` .
1206+
1207+ Unlike [ ` process.hrtime() ` ] [ ] , it does not support an additional ` time `
1208+ argument since the difference can just be computed directly
1209+ by subtraction of the two ` bigint ` s.
1210+
1211+ ``` js
1212+ const start = process .hrtime .bigint ();
1213+ // 191051479007711n
1214+
1215+ setTimeout (() => {
1216+ const end = process .hrtime .bigint ();
1217+ // 191052633396993n
1218+
1219+ console .log (` Benchmark took ${ end - start} nanoseconds` );
1220+ // Benchmark took 1154389282 nanoseconds
1221+ }, 1000 );
1222+ ```
1223+
11941224## process.initgroups(user, extraGroup)
11951225<!-- YAML
11961226added: v0.9.4
@@ -2035,6 +2065,8 @@ cases:
20352065[ `process.execPath` ] : #process_process_execpath
20362066[ `process.exit()` ] : #process_process_exit_code
20372067[ `process.exitCode` ] : #process_process_exitcode
2068+ [ `process.hrtime()` ] : #process_process_hrtime_time
2069+ [ `process.hrtime.bigint()` ] : #process_process_hrtime_bigint
20382070[ `process.kill()` ] : #process_process_kill_pid_signal
20392071[ `process.setUncaughtExceptionCaptureCallback()` ] : process.html#process_process_setuncaughtexceptioncapturecallback_fn
20402072[ `promise.catch()` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
0 commit comments