stop method

void stop()

Implementation

void stop() {
  assert(_isRunning);
  _isRunning = false;
  _stopwatch.stop();

  final startEvent = DurationEvent()
    ..name = configuration.timerName
    ..pid = configuration.pid
    ..tid = configuration.tid
    ..phase = DurationEventPhase.begin
    ..ts = _startDuration;

  final endEvent = DurationEvent()
    ..name = configuration.timerName
    ..pid = configuration.pid
    ..tid = configuration.tid
    ..phase = DurationEventPhase.end
    ..ts = _startDuration
        .add(Duration(microseconds: _stopwatch.elapsedMicroseconds));

  _collector([startEvent, endEvent]);
}