Skip to content

Commit a3c7e13

Browse files
committed
bench: console.time around setup and warmup
1 parent b4903b3 commit a3c7e13

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bench/bench.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ const yieldForTick = typeof setTimeout === "function"
2626
// Benchmark running an action n times.
2727
async function benchmark(setup, action, tearDown = () => {}) {
2828
__benchmarkResults = [];
29+
30+
console.time("setup");
2931
await setup();
32+
console.timeEnd("setup");
3033

3134
// Warm up the JIT.
35+
console.time("warmup");
3236
for (let i = 0; i < WARM_UP_ITERATIONS; i++) {
3337
await action();
3438
await yieldForTick();
3539
}
40+
console.timeEnd("warmup");
3641

3742
const stats = new Stats("ms");
3843

0 commit comments

Comments
 (0)