(time)
| 76 | const hrBigintValues = new BigUint64Array(binding.hrtimeBuffer.buffer, 0, 1); |
| 77 | |
| 78 | function hrtime(time) { |
| 79 | binding.hrtime(); |
| 80 | |
| 81 | if (time !== undefined) { |
| 82 | validateArray(time, 'time'); |
| 83 | if (time.length !== 2) { |
| 84 | throw new ERR_OUT_OF_RANGE('time', 2, time.length); |
| 85 | } |
| 86 | |
| 87 | const sec = (hrValues[0] * 0x100000000 + hrValues[1]) - time[0]; |
| 88 | const nsec = hrValues[2] - time[1]; |
| 89 | const needsBorrow = nsec < 0; |
| 90 | return [needsBorrow ? sec - 1 : sec, needsBorrow ? nsec + 1e9 : nsec]; |
| 91 | } |
| 92 | |
| 93 | return [ |
| 94 | hrValues[0] * 0x100000000 + hrValues[1], |
| 95 | hrValues[2], |
| 96 | ]; |
| 97 | } |
| 98 | |
| 99 | function hrtimeBigInt() { |
| 100 | binding.hrtimeBigInt(); |
no outgoing calls
no test coverage detected
searching dependent graphs…