Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2021-05-20 12:06:16 +0300
committerZiJian Liu <Lxxyxzj@gmail.com>2021-05-23 09:52:14 +0300
commitba84524a7ccb7c668c4f19c958bb0c7dc5ab9cdf (patch)
treece536b7548f9371c3113bc9e89dfc06a66e64f09 /benchmark
parentbf06daa6567067b0a1a1468dda5f2a2b0fcb8539 (diff)
benchmark: fix http elapsed time
Since commit 4e9ad206e22, elapsed time is expected to be a BigInt instead of an array. Refs: https://github.com/nodejs/node/pull/38369 PR-URL: https://github.com/nodejs/node/pull/38743 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/_http-benchmarkers.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js
index e5ba6188f1c..615579cba52 100644
--- a/benchmark/_http-benchmarkers.js
+++ b/benchmark/_http-benchmarkers.js
@@ -222,7 +222,7 @@ exports.run = function(options, callback) {
return;
}
- const benchmarker_start = process.hrtime();
+ const benchmarker_start = process.hrtime.bigint();
const child = benchmarker.create(options);
@@ -233,7 +233,7 @@ exports.run = function(options, callback) {
child.stdout.on('data', (chunk) => stdout += chunk);
child.once('close', (code) => {
- const elapsed = process.hrtime(benchmarker_start);
+ const benchmark_end = process.hrtime.bigint();
if (code) {
let error_message = `${options.benchmarker} failed with ${code}.`;
if (stdout !== '') {
@@ -250,6 +250,7 @@ exports.run = function(options, callback) {
return;
}
+ const elapsed = benchmark_end - benchmarker_start;
callback(null, code, options.benchmarker, result, elapsed);
});