The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
ReadonlyconcurrencyExecutes 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.ReadonlyiterationsThe iteration limit per task; see BenchOptions.iterations.
ReadonlynameThe benchmark name.
ReadonlynowA function to get a timestamp.
Removes a previously registered event listener.
Optionaloptions: boolean | EventListenerOptionsThe removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsReadonlyretainShould samples be retained for further custom processing
ReadonlyruntimeThe JavaScript runtime environment.
ReadonlyruntimeThe JavaScript runtime version.
ReadonlysetupA setup function called once per task and phase.
Optional ReadonlysignalAn AbortSignal to cancel the benchmark.
ReadonlysubtractWhether to subtract an estimated timestamp provider call overhead from each raw latency sample.
Incompatible with concurrency: 'task'. Enforced at construction and
re-checked at the start of Bench.run to guard against untyped
(JS-side) mutation of the readonly concurrency field after
construction.
ReadonlyteardownA teardown function called once per task and phase.
ReadonlythresholdMaximum concurrent iterations within a task; only for concurrency: 'task'.
ReadonlythrowsWhether to throw an error if a task function throws
ReadonlytimeThe time budget per task in milliseconds; see BenchOptions.time.
Optional ReadonlytimerThe estimated cost of one timestamp provider call in milliseconds.
undefined when subtractTimerOverhead is false.
Otherwise calibrated once at construction time via
calibrateTimerOverhead.
ReadonlytimestampA timestamp provider and its related functions.
ReadonlywarmupWhether to warmup the tasks before running them
ReadonlywarmupThe warmup iteration limit; see BenchOptions.warmupIterations.
ReadonlywarmupThe warmup time budget in milliseconds; see BenchOptions.warmupTime.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Gets a task based on the task name.
the task name
the Task instance or undefined if not found
Removes a benchmark task from the task map.
the task name
the Bench instance
Resets each task's run count, statistics and diagnostics. Results remain
available as not-started or aborted; aborted signals are not rearmed.
Returns the tasks results as a table.
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.