Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad committed Apr 21, 2024
1 parent 48dc328 commit fe2fe06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ It may make your benchmarks slower, check #42.
## Concurrency

- When `mode` is set to `null` (default), concurrency is disabled.
- When `mode` is set to 'task', each task's iterations run concurrently.
- When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.
- When `mode` is set to 'bench', different tasks within the bench run concurrently. Concurrent cycles.

```ts
Expand All @@ -389,8 +389,6 @@ await bench.run()
await bench.runConcurrently(10, "task") // with runConcurrently, mode is set to 'bench' by default
```

The options way of doing concurrency also affects `bench.warmup` and makes it concurrent too. Useful for concurrent warm ups.

## Prior art

- [Benchmark.js](https://github.com/bestiejs/benchmark.js)
Expand Down
2 changes: 1 addition & 1 deletion src/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class Bench extends EventTarget {
* Executes tasks concurrently based on the specified concurrency mode.
*
* - When `mode` is set to `null` (default), concurrency is disabled.
* - When `mode` is set to 'task', each task's iterations run concurrently.
* - When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.
* - When `mode` is set to 'bench', different tasks within the bench run concurrently.
*/
concurrency: 'task' | 'bench' | null = null;
Expand Down

0 comments on commit fe2fe06

Please sign in to comment.