diff options
Diffstat (limited to 'lib/internal/process')
-rw-r--r-- | lib/internal/process/per_thread.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index d219cd7298..303e71703d 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -41,7 +41,6 @@ function assert(x, msg) { function wrapProcessMethods(binding) { const { hrtime: _hrtime, - hrtimeBigInt: _hrtimeBigInt, cpuUsage: _cpuUsage, memoryUsage: _memoryUsage, resourceUsage: _resourceUsage @@ -113,10 +112,10 @@ function wrapProcessMethods(binding) { // The 3 entries filled in by the original process.hrtime contains // the upper/lower 32 bits of the second part of the value, // and the remaining nanoseconds of the value. - const hrValues = new Uint32Array(3); + const hrValues = new Uint32Array(_hrtime.buffer); function hrtime(time) { - _hrtime(hrValues); + _hrtime.hrtime(); if (time !== undefined) { if (!ArrayIsArray(time)) { @@ -140,9 +139,9 @@ function wrapProcessMethods(binding) { // Use a BigUint64Array in the closure because this is actually a bit // faster than simply returning a BigInt from C++ in V8 7.1. - const hrBigintValues = new BigUint64Array(1); + const hrBigintValues = new BigUint64Array(_hrtime.buffer, 0, 1); function hrtimeBigInt() { - _hrtimeBigInt(hrBigintValues); + _hrtime.hrtimeBigInt(); return hrBigintValues[0]; } |