feat(bench): add warmup and n for controlling number of iterations (#28123)

```ts
Deno.bench("benchmark", { warmup: 10_000, n: 1000 }, () => {
  ...
});
```

Closes #17649
This commit is contained in:
David Sherret 2025-02-18 12:44:43 -05:00 committed by GitHub
parent 9b9eeabcc8
commit 116def7fad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 107 additions and 41 deletions

View file

@ -75,17 +75,6 @@ const DenoNs = globalThis.Deno;
* completed: boolean,
* failed: boolean,
* }} TestStepState
*
* @typedef {{
* id: number,
* name: string,
* fn: BenchFunction
* origin: string,
* ignore: boolean,
* only: boolean.
* sanitizeExit: boolean,
* permissions: PermissionOptions,
* }} BenchDescription
*/
/** @type {Map<number, TestState | TestStepState>} */