Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MeasureOptions<Measured, BeforeEach>

Options for Benchmark.measure().

Type parameters

  • Measured = any

  • BeforeEach = any

Hierarchy

  • MeasureOptions

Index

Properties

iterations: number

The number of times to call the function and measure its duration.

default

100

marginOfErrorUnder?: number

If the margin of error at 95% confidence level exceeds this many milliseconds, throw a PerformanceError.

maxUnder?: number

If the maximum measured duration exceeds this many milliseconds, throw a PerformanceError.

meanUnder?: number

If the mean measured duration exceeds this many milliseconds, throw a PerformanceError.

minUnder?: number

If the minimum measured duration exceeds this many milliseconds, throw a PerformanceError.

serial: boolean

Whether to wait for each iteration to finish before starting the next.

default

true

standardDeviationUnder?: number

If the standard deviation of all durations measured exceeds this many milliseconds, throw a PerformanceError.

verify: boolean

Whether to make use of the options like meanUnder and minUnder.

default

true

Methods

  • afterEach(context: { beforeEach: Awaited<BeforeEach>; measured: Awaited<Measured> }): any
  • Callback to invoke after each iteration.

    Parameters

    • context: { beforeEach: Awaited<BeforeEach>; measured: Awaited<Measured> }
      • beforeEach: Awaited<BeforeEach>

        The return value of the beforeEach function for the current iteration.

      • measured: Awaited<Measured>

        The return value of the measured function for the current iteration.

    Returns any

  • beforeEach(): BeforeEach
  • Callback to invoke before each iteration.

    Returns BeforeEach

Generated using TypeDoc