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
  • Loading branch information
aduh95 committed May 20, 2021
1 parent 42cceff commit 18a0c63
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmark/_http-benchmarkers.js
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 18a0c63

Please sign in to comment.