BenchmarkHelper extension

on

Methods

measure(void f(), int ticks) → ({int iter, int ticks})
Measures the runtime of f for ticks clock ticks and reports the average runtime expressed as clock ticks.
measureAsync(Future<void> f(), int ticks) Future<({int iter, int ticks})>
Measures the runtime of f for ticks clock ticks and reports the average runtime expressed as clock ticks.
warmup(void f(), {Duration duration = const Duration(milliseconds: 200), int preRuns = 3}) → ({int iter, int ticks})
Measures the runtime of f for duration and reports the average runtime expressed as clock ticks.
warmupAsync(Future<void> f(), {Duration duration = const Duration(milliseconds: 200), int preRuns = 3}) Future<({int iter, int ticks})>
Measures the runtime of f for duration and reports the average runtime expressed as clock ticks.

Static Properties

frequency int
Stopwatch frequency: ticks per second.
final
sampleSize SampleSizeEstimator
getter/setter pair

Static Methods

interpolateExp(num x, num x1, num y1, num x2, num y2) double
Returns the result of the exponential interpolation between the points (x1,y1) and (x2, y2).
interpolateLin(num x, num x1, num y1, num x2, num y2) double
Returns the result of the linear interpolation between the points (x1,y1) and (x2, y2).
microsecondsToTicks(int microseconds) int
Converts microseconds to clock ticks.
millisecondsToTicks(int milliseconds) int
Converts milliseconds to clock ticks.
sampleSizeDefault(int clockTicks) → ({int inner, int outer})
Returns a record with type ({int outer, int inner}) holding the:
secondsToTicks(int seconds) int
Converts seconds to clock ticks.
ticksToMicroseconds(int ticks) double
Converts clock ticks to microseconds.
ticksToMilliseconds(int ticks) double
Converts clock ticks to milliseconds.
ticksToSeconds(int ticks) double
Converts clock ticks to seconds.