| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 59af1d7 commit bff7e3c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,21 +57,13 @@ const { exitCodes: { kNoFailure } } = internalBinding('errors'); | |||
| 57 | 57 | ||
| 58 | 58 | const binding = internalBinding('process_methods'); | |
| 59 | 59 | ||
| 60 | - let hrValues; | ||
| 61 | - let hrBigintValues; | ||
| 62 | - | ||
| 63 | - function refreshHrtimeBuffer() { | ||
| 64 | - // The 3 entries filled in by the original process.hrtime contains | ||
| 65 | - // the upper/lower 32 bits of the second part of the value, | ||
| 66 | - // and the remaining nanoseconds of the value. | ||
| 67 | - hrValues = binding.hrtimeBuffer; | ||
| 68 | - // Use a BigUint64Array in the closure because this is actually a bit | ||
| 69 | - // faster than simply returning a BigInt from C++ in V8 7.1. | ||
| 70 | - hrBigintValues = new BigUint64Array(binding.hrtimeBuffer.buffer, 0, 1); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - // Create the buffers. | ||
| 74 | - refreshHrtimeBuffer(); | ||
| 60 | + // The 3 entries filled in by the original process.hrtime contains | ||
| 61 | + // the upper/lower 32 bits of the second part of the value, | ||
| 62 | + // and the remaining nanoseconds of the value. | ||
| 63 | + const hrValues = binding.hrtimeBuffer; | ||
| 64 | + // Use a BigUint64Array because this is actually a bit | ||
| 65 | + // faster than simply returning a BigInt from C++ in V8 7.1. | ||
| 66 | + const hrBigintValues = new BigUint64Array(binding.hrtimeBuffer.buffer, 0, 1); | ||
| 75 | 67 | ||
| 76 | 68 | function hrtime(time) { | |
| 77 | 69 | binding.hrtime(); | |
@@ -425,5 +417,4 @@ module.exports = { | |||
| 425 | 417 | wrapProcessMethods, | |
| 426 | 418 | hrtime, | |
| 427 | 419 | hrtimeBigInt, | |
| 428 | - refreshHrtimeBuffer, | ||
| 429 | 420 | }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -211,8 +211,6 @@ function patchProcessObject(expandArgv1) { | |||
| 211 | 211 | const binding = internalBinding('process_methods'); | |
| 212 | 212 | binding.patchProcessObject(process); | |
| 213 | 213 | ||
| 214 | - require('internal/process/per_thread').refreshHrtimeBuffer(); | ||
| 215 | - | ||
| 216 | 214 | // Since we replace process.argv[0] below, preserve the original value in case the user needs it. | |
| 217 | 215 | ObjectDefineProperty(process, 'argv0', { | |
| 218 | 216 | __proto__: null, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments