tinybench - v5.0.1
    Preparing search index...

    Class Task

    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, ...

    Hierarchy

    • EventTarget
      • Task
    Index

    Constructors

    Properties

    name: string

    The task name

    result: undefined | Readonly<TaskResult>

    The result object

    runs: number = 0

    The number of times the task function has been executed

    Methods

    • Type Parameters

      Parameters

      • type: K
      • listener: TaskEventsMap[K]
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Parameters

      • event: Event

      Returns boolean

    • Type Parameters

      Parameters

      • type: K
      • listener: TaskEventsMap[K]
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Internal

      reset the task to make the Task.runs a zero-value and remove the Task.result object property

      Returns void

    • Internal

      run the current task and write the results in Task.result object property

      Returns Promise<Task>

      the current task

    • Internal

      run the current task and write the results in Task.result object property (sync version)

      Returns this

      the current task

    • Internal

      warmup the current task

      Returns Promise<void>

    • Internal

      warmup the current task (sync version)

      Returns void