stop method

int stop({
  1. String? ref,
})

Stops the stopwatch for ref and returns total accumulated seconds.

Implementation

int stop({String? ref}) {
  ref ??= currentReference;
  if (_stopwatches.containsKey(ref)) {
    if (_stopwatches[ref]!.isRunning) {
      pause(ref: ref);
    }
    AppConfig.logger.i('NeomStopwatch stopped for $ref; total: ${_accumulatedTime[ref]}s.');
    return _accumulatedTime[ref]!;
  }
  return 0;
}