From: Jérôme Benoit Date: Tue, 10 Feb 2026 21:27:54 +0000 (+0100) Subject: fix(bench): correct tinybench API usage and busy-wait timing X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3a65a23a3237fd499970d8ae0c09929c7317484f;p=benchmarks-js.git fix(bench): correct tinybench API usage and busy-wait timing - fibonacci.mjs: use bench.table() instead of bench.results for consistent output - busy-wait.mjs: increase bench time to account for interval delay --- diff --git a/busy-wait.mjs b/busy-wait.mjs index d547be9..dbf6c59 100644 --- a/busy-wait.mjs +++ b/busy-wait.mjs @@ -67,7 +67,7 @@ async function sleepTimeoutBusyWait (timeoutMs, intervalMs = interval) { } while (performance.now() < timeoutTimestampMs) } -const bench = new Bench({ name: 'Busy wait', time: timeout }) +const bench = new Bench({ name: 'Busy wait', time: timeout + interval }) bench.add('dummyTimeoutBusyWait', () => { dummyTimeoutBusyWait(timeout) diff --git a/fibonacci.mjs b/fibonacci.mjs index 4814e4b..f926486 100644 --- a/fibonacci.mjs +++ b/fibonacci.mjs @@ -78,4 +78,4 @@ bench await bench.run() -console.table(bench.results) +console.table(bench.table())