]> Piment Noir Git Repositories - benchmarks-js.git/commitdiff
fix(bench): correct tinybench API usage and busy-wait timing
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Feb 2026 21:27:54 +0000 (22:27 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 10 Feb 2026 21:27:54 +0000 (22:27 +0100)
- 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
fibonacci.mjs

index d547be9ce727c29ad06d872057d7c52705074cc5..dbf6c5987115ba651833dc42b156c85e410aa93a 100644 (file)
@@ -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)
index 4814e4b0187c0ec377d6b12128cd5715168e3072..f926486b4f489ab883654f7c51bf6da2883d545f 100644 (file)
@@ -78,4 +78,4 @@ bench
 
 await bench.run()
 
-console.table(bench.results)
+console.table(bench.table())