timeAction function

Duration timeAction(
  1. VoidCallback action
)

Measures the amount of time action takes.

Implementation

Duration timeAction(VoidCallback action) {
  final Stopwatch stopwatch = Stopwatch()..start();
  action();
  stopwatch.stop();
  return stopwatch.elapsed;
}