Skip to main content

Class: Benchmark

Extends

  • BenchmarkBase

Constructors

new Benchmark()

new Benchmark(name, options?): Benchmark

Parameters

name: string

options?

options.action?: Action

options.iterations?: number

options.reporter?: BenchmarkReporter

options.setup?: SetupMethod

options.teardown?: TeardownMethod

options.timeout?: number

Returns

Benchmark

Overrides

BenchmarkBase.constructor

Defined in

src/benchmark.ts:29

Properties

action?

optional action: Action

Inherited from

BenchmarkBase.action

Defined in

src/shared-api.ts:13


errorStrategy

errorStrategy: ErrorStrategy = ErrorStrategy.Continue

Overrides

BenchmarkBase.errorStrategy

Defined in

src/benchmark.ts:27


name

name: string

Defined in

src/benchmark.ts:30


setupEachMethods

setupEachMethods: SetupMethod[] = []

Inherited from

BenchmarkBase.setupEachMethods

Defined in

src/shared-api.ts:9


setupMethods

setupMethods: SetupMethod[] = []

Inherited from

BenchmarkBase.setupMethods

Defined in

src/shared-api.ts:10


teardownEachMethods

teardownEachMethods: TeardownMethod[] = []

Inherited from

BenchmarkBase.teardownEachMethods

Defined in

src/shared-api.ts:12


teardownMethods

teardownMethods: TeardownMethod[] = []

Inherited from

BenchmarkBase.teardownMethods

Defined in

src/shared-api.ts:11


variations

variations: Variation[] = []

Defined in

src/benchmark.ts:20

Methods

run()

run(): Promise<Result[]>

Returns

Promise<Result[]>

Defined in

src/benchmark.ts:121


withAction()

withAction(action): this

Parameters

action: Action

Returns

this

Overrides

BenchmarkBase.withAction

Defined in

src/benchmark.ts:96


withErrorStrategy()

withErrorStrategy(errorStrategy): this

Parameters

errorStrategy: ErrorStrategy

Returns

this

Inherited from

BenchmarkBase.withErrorStrategy

Defined in

src/shared-api.ts:41


withIterations()

withIterations(iterations): this

Parameters

iterations: number

Returns

this

Defined in

src/benchmark.ts:101


withPerformanceObserver()

withPerformanceObserver(options?): this

Parameters

options?: PerformanceObserverOptions

Returns

this

Defined in

src/benchmark.ts:116


withReporter()

withReporter(reporter): this

Parameters

reporter: BenchmarkReporter

Returns

this

Defined in

src/benchmark.ts:111


withSetup()

withSetup(setup): this

Parameters

setup: SetupMethod

Returns

this

Overrides

BenchmarkBase.withSetup

Defined in

src/benchmark.ts:86


withSetupEach()

withSetupEach(setup): this

Parameters

setup: SetupMethod

Returns

this

Inherited from

BenchmarkBase.withSetupEach

Defined in

src/shared-api.ts:21


withTeardown()

withTeardown(teardown): this

Parameters

teardown: TeardownMethod

Returns

this

Overrides

BenchmarkBase.withTeardown

Defined in

src/benchmark.ts:91


withTeardownEach()

withTeardownEach(teardown): this

Parameters

teardown: TeardownMethod

Returns

this

Inherited from

BenchmarkBase.withTeardownEach

Defined in

src/shared-api.ts:31


withTimeout()

withTimeout(timeout): this

Parameters

timeout: number

Returns

this

Defined in

src/benchmark.ts:106


withVariation()

withVariation(name, builder)

withVariation(name, builder): this

Parameters

name: string

builder

Returns

this

Defined in

src/benchmark.ts:59

withVariation(variation)

withVariation(variation): this

Parameters

variation: Variation

Returns

this

Defined in

src/benchmark.ts:63


withVariations()

withVariations(variations): this

Parameters

variations: Variation[]

Returns

this

Defined in

src/benchmark.ts:81