stopwatch method

Stopwatch stopwatch([
  1. bool start = true
])

Satrts a new Stopwatch and returns it.

If start is true (default) the Stopwatch is started immediately.

Implementation

Stopwatch stopwatch([bool start = true]) {
  final stopwatch = Stopwatch();
  if (start) {
    stopwatch.start();
  }

  return stopwatch;
}