Skip to content

Commit

Permalink
benchmark: fix http elapsed time
Browse files Browse the repository at this point in the history
Since commit 4e9ad20, elapsed time is expected to be a BigInt
instead of an array.

Refs: nodejs#38369

PR-URL: nodejs#38743
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Zijian Liu <[email protected]>
  • Loading branch information
aduh95 authored and Lxxyx committed May 23, 2021
1 parent bf06daa commit ba84524
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmark/_http-benchmarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 !== '') {
Expand All @@ -250,6 +250,7 @@ exports.run = function(options, callback) {
return;
}

const elapsed = benchmark_end - benchmarker_start;
callback(null, code, options.benchmarker, result, elapsed);
});

Expand Down

0 comments on commit ba84524

Please sign in to comment.