deno/tests/specs/bench/iterations/main.bench.ts
David Sherret 116def7fad
feat(bench): add warmup and n for controlling number of iterations (#28123)
```ts
Deno.bench("benchmark", { warmup: 10_000, n: 1000 }, () => {
  ...
});
```

Closes #17649
2025-02-18 12:44:43 -05:00

17 lines
249 B
TypeScript

Deno.bench("above 10,000,000 iterations", {
n: 10_000_001,
warmup: 10,
}, () => {
});
Deno.bench("below 10,000,000 iterations", {
n: 1,
warmup: 10,
}, () => {
});
Deno.bench("negative iterations", {
n: -10,
warmup: -10,
}, () => {
});