From 24f711afea6f03563889130f43e6818e80767f02 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 10 Feb 2026 22:38:44 +0100 Subject: [PATCH] fix(bench): disable warmup for slow busy-wait benchmarks Tinybench's default warmup phase caused timeouts with 2-second busy-wait functions. Disable warmup and set minimum iterations for proper measurement. --- busy-wait.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/busy-wait.mjs b/busy-wait.mjs index dbf6c59..20ec30a 100644 --- a/busy-wait.mjs +++ b/busy-wait.mjs @@ -67,7 +67,12 @@ async function sleepTimeoutBusyWait (timeoutMs, intervalMs = interval) { } while (performance.now() < timeoutTimestampMs) } -const bench = new Bench({ name: 'Busy wait', time: timeout + interval }) +const bench = new Bench({ + iterations: 2, + name: 'Busy wait', + time: 5000, + warmup: false, +}) bench.add('dummyTimeoutBusyWait', () => { dummyTimeoutBusyWait(timeout) -- 2.53.0