The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
The 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.
Sample-based timer-resolution heuristic for the last run. Returns the
smallest positive latency repeated at least twice, otherwise the minimum
positive latency. Uses timer-measured samples after overhead correction;
samples supplied via overriddenDuration are excluded. This does not
guarantee a bound on the timer's resolution.
The estimate in milliseconds, or undefined when no eligible
sample remains positive after correction.
The name of the task.
The task name as a string
The result of the task.
The task result including state, statistics, and runtime information
The recorded sample count from run statistics or task-concurrent execution. Task-concurrent warmup also updates this counter; other warmup and async-detection calls do not.
The recorded sample count.
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().
Clears the run count, statistics and diagnostics. The result becomes
not-started, or stays aborted if a signal has aborted. Does not rearm
an aborted signal.
whether to emit the reset event or not
Runs the current task and writes the results in Task.result object property.
the current task
Runs the current task synchronously and writes the results in Task.result object property.
the current task
Warms up the current task.
Warms up the current task synchronously.
A class that represents each benchmark task in Tinybench. It keeps track of the results, name, the task function, the number times the task function has been executed, ...