runTimed<T> function

TimedResult<T> runTimed<T>(
  1. T fn()
)

Implementation

TimedResult<T> runTimed<T>(T Function() fn) {
  _stopwatch
    ..reset()
    ..start();
  final result = fn();
  _stopwatch.stop();

  return TimedResult(result, _stopwatch.elapsedMicroseconds);
}