From 3a65a23a3237fd499970d8ae0c09929c7317484f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 10 Feb 2026 22:27:54 +0100 Subject: [PATCH] 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 --- busy-wait.mjs | 2 +- fibonacci.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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()) -- 2.53.0