From 18a0c638c19e45270afecccd5ad3ff0d2dd956b5 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 20 May 2021 11:06:16 +0200 Subject: [PATCH] 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 --- benchmark/_http-benchmarkers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index e5ba6188f1cc81..615579cba52416 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); });