Executes tasks concurrently based on the specified concurrency mode.
mode
is set to null
(default), concurrency is disabled.mode
is set to 'task', each task's iterations (calls of a task function) run concurrently.mode
is set to 'bench', different tasks within the bench run concurrently. Concurrent cycles.Optional
Readonly
nameThe benchmark name.
Readonly
optsThe options.
Readonly
runtimeThe JavaScript runtime environment.
Readonly
runtimeThe JavaScript runtime version.
The maximum number of concurrent tasks to run
tasks results as an array
the tasks results as an array
Adds a new handler for the type
event. Any given listener
is added only once per type
and per capture
option value.
If the once
option is true, the listener
is removed after the next time a type
event is dispatched.
The capture
option is not used by Node.js in any functional way other than tracking registered event listeners per the EventTarget
specification.
Specifically, the capture
option is used as part of the key when registering a listener
.
Any individual listener
may be added once with capture = false
, and once with capture = true
.
Optional
options: boolean | AddEventListenerOptionsRemoves the event listener in target's event listener list with the same type, callback, and options.
Optional
options: boolean | EventListenerOptionstable of the tasks results
Optional
convert: (task: Task) => Record<string, undefined | string | number>an optional callback to convert the task result to a table record
the tasks results as an array of table records
The Bench class keeps track of the benchmark tasks and controls them.