@@ -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+
11621165The ` process.hrtime() ` method returns the current high-resolution real time
11631166in a ` [seconds, nanoseconds] ` tuple ` Array ` , where ` nanoseconds ` is the
11641167remaining part of the real time that can't be represented in second precision.
@@ -1187,6 +1190,33 @@ setTimeout(() => {
11871190}, 1000 );
11881191```
11891192
1193+ ## process.hrtime.bigint()
1194+ <!-- YAML
1195+ added: REPLACEME
1196+ -->
1197+
1198+ * Returns: {bigint}
1199+
1200+ The ` bigint ` version of the [ ` process.hrtime() ` ] [ ] method returning the
1201+ current high-resolution real time in a ` bigint ` .
1202+
1203+ Unlike [ ` process.hrtime() ` ] [ ] , it does not support an additional ` time `
1204+ argument since the difference can just be computed directly
1205+ by subtraction of the two ` bigint ` s.
1206+
1207+ ``` js
1208+ const start = process .hrtime .bigint ();
1209+ // 191051479007711n
1210+
1211+ setTimeout (() => {
1212+ const end = process .hrtime .bigint ();
1213+ // 191052633396993n
1214+
1215+ console .log (` Benchmark took ${ end - start} nanoseconds` );
1216+ // Benchmark took 1154389282 nanoseconds
1217+ }, 1000 );
1218+ ```
1219+
11901220## process.initgroups(user, extraGroup)
11911221<!-- YAML
11921222added: v0.9.4
@@ -2030,6 +2060,8 @@ cases:
20302060[ `process.execPath` ] : #process_process_execpath
20312061[ `process.exit()` ] : #process_process_exit_code
20322062[ `process.exitCode` ] : #process_process_exitcode
2063+ [ `process.hrtime()` ] : #process_process_hrtime_time
2064+ [ `process.hrtime.bigint()` ] : #process_process_hrtime_bigint
20332065[ `process.kill()` ] : #process_process_kill_pid_signal
20342066[ `process.setUncaughtExceptionCaptureCallback()` ] : process.html#process_process_setuncaughtexceptioncapturecallback_fn
20352067[ `promise.catch()` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
0 commit comments