timeOperation function

Duration timeOperation(
  1. void operation()
)

Times the specified synchronous operation.

Implementation

Duration timeOperation(void Function() operation) {
  var stopwatch = Stopwatch()..start();
  operation();
  return stopwatch.elapsed;
}