Options
All
  • Public
  • Public/Protected
  • All
Menu

kelonio

Index

Variables

benchmark: Benchmark = ...

Default Benchmark instance for shared usage throughout your tests. Each instance stores its own state from measurement results, so if you want to avoid global state, you can create additional instances as well.

Functions

  • measure<Measured, BeforeEach>(fn: (context: { beforeEach: Awaited<BeforeEach> }) => Measured, options?: Partial<MeasureOptions<Measured, BeforeEach>>): Promise<Measurement>
  • Measure the time it takes for a function to execute.

    Type parameters

    • Measured = undefined

    • BeforeEach = undefined

    Parameters

    • fn: (context: { beforeEach: Awaited<BeforeEach> }) => Measured

      Function to measure.

        • (context: { beforeEach: Awaited<BeforeEach> }): Measured
        • Parameters

          • context: { beforeEach: Awaited<BeforeEach> }
            • beforeEach: Awaited<BeforeEach>

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

          Returns Measured

    • options: Partial<MeasureOptions<Measured, BeforeEach>> = {}

      Options to customize the measurement.

    Returns Promise<Measurement>

Generated using TypeDoc