You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`async run()`: run the added tasks that were registered using the `add` method
134
-
-`async runConcurrently(threshold: number = Infinity, mode: "bench" | "task" = "bench")`: similar to the `run` method but runs concurrently rather than sequentially. See the [Concurrency](#Concurrency) section.
135
134
-`async warmup()`: warmup the benchmark tasks
136
-
-`async warmupConcurrently(threshold: number = Infinity, mode: "bench" | "task" = "bench")`: warmup the benchmark tasks concurrently
137
135
-`reset()`: reset each task and remove its result
138
136
-`add(name: string, fn: Fn, opts?: FnOpts)`: add a benchmark task to the task map
139
137
-`Fn`: `() => any | Promise<any>`
@@ -367,15 +365,10 @@ It may make your benchmarks slower, check #42.
367
365
- When `mode` is set to 'bench', different tasks within the bench run concurrently. Concurrent cycles.
368
366
369
367
```ts
370
-
// options way (recommended)
371
-
bench.threshold=10; // The maximum number of concurrent tasks to run. Defaults to Infinity.
368
+
bench.threshold=10; // The maximum number of concurrent tasks to run. Defaults to Number.POSITIVE_INFINITY.
372
369
bench.concurrency='task'; // The concurrency mode to determine how tasks are run.
373
-
//await bench.warmup();
370
+
awaitbench.warmup();
374
371
awaitbench.run();
375
-
376
-
// standalone method way
377
-
// await bench.warmupConcurrently(10, 'task');
378
-
awaitbench.runConcurrently(10, 'task'); // with runConcurrently, mode is set to 'bench' by default
0 commit comments