ChatterBox.Client.Universal.Background.StatsManager.StopCallWatch C# (CSharp) Method

StopCallWatch() public method

public StopCallWatch ( ) : void
return void
        public void StopCallWatch()
        {
            if (_callWatch != null)
            {
                _callWatch.Stop();
                DateTime currentDateTime = DateTime.Now;
                TimeSpan time = _callWatch.Elapsed;
                Task.Run(() => _telemetry.TrackRequest("Call Duration", currentDateTime,
                   time,
                   "200", true));  // Response code, success
                if (_metricsCollector != null)
                {
                    _metricsCollector.TrackCurrentDelayMetrics();
                    _metricsCollector.TrackNetworkQualityMetrics();
                }
                if (_networkTimer != null)
                {
                    _networkTimer.Dispose();
                }
            }
        }
    }