Skip to content

Documentation


Documentation / @blazetrails/activesupport / Benchmark

Class: Benchmark ​

Defined in: packages/activesupport/lib/benchmark.ts:3

Constructors ​

Constructor ​

new Benchmark(): Benchmark

Returns ​

Benchmark

Methods ​

realtime() ​

The Promise-returning overloads have no Ruby counterpart because Ruby has no async boundary: yield in benchmark.rb:17 returns when the work is done. A block whose work is deferred to a promise measures zero unless the clock is read again when that promise settles, which is what the thenable arm below does — the same measurement, moved to where the work actually finishes.

Call Signature ​

static realtime<T>(unit, block): Promise<number>

Defined in: packages/activesupport/lib/benchmark.ts:4

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
unitstring
block() => Promise<T>
Returns ​

Promise<number>

Call Signature ​

static realtime<T>(unit, block): number

Defined in: packages/activesupport/lib/benchmark.ts:5

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
unitstring
block() => T
Returns ​

number

Call Signature ​

static realtime<T>(block): Promise<number>

Defined in: packages/activesupport/lib/benchmark.ts:6

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
block() => Promise<T>
Returns ​

Promise<number>

Call Signature ​

static realtime<T>(block): number

Defined in: packages/activesupport/lib/benchmark.ts:7

Type Parameters ​
Type Parameter
T
Parameters ​
ParameterType
block() => T
Returns ​

number