duration property

Duration get duration

Implementation

Duration get duration {
  if (_start == null) {
    throw StateError('Stopwatch not started');
  } else if (_stop == null) {
    throw StateError('Stopwatch not stopped');
  } else {
    return Duration(microseconds: _stop! - _start!);
  }
}