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
staticrealtime<T>(unit,block):Promise<number>
Defined in: packages/activesupport/lib/benchmark.ts:4
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
unit | string |
block | () => Promise<T> |
Returns
Promise<number>
Call Signature
staticrealtime<T>(unit,block):number
Defined in: packages/activesupport/lib/benchmark.ts:5
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
unit | string |
block | () => T |
Returns
number
Call Signature
staticrealtime<T>(block):Promise<number>
Defined in: packages/activesupport/lib/benchmark.ts:6
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
block | () => Promise<T> |
Returns
Promise<number>
Call Signature
staticrealtime<T>(block):number
Defined in: packages/activesupport/lib/benchmark.ts:7
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
block | () => T |
Returns
number