Betzalel.SimpleMulticastAnalyzer.Infrastructure.HighResolutionTimer.Stop C# (CSharp) Method

Stop() public method

Stops timer.
/// If the timer has already been disposed. ///
public Stop ( ) : void
return void
        public void Stop()
        {
            #region Require

              if (disposed)
              {
            throw new ObjectDisposedException("Timer");
              }

              #endregion

              #region Guard

              if (!running)
              {
            return;
              }

              #endregion

              // Stop and destroy timer.
              int result = timeKillEvent(timerID);

              Debug.Assert(result == TIMERR_NOERROR);

              running = false;

              if (IsAsync)
              {
            Task.Factory.StartNew(() => OnStopped(new EventArgs()));
              }
              else
              {
            OnStopped(EventArgs.Empty);
              }
        }