/// <summary> /// Stops the current DB timing. /// </summary> public void Stop() { DurationMilliseconds = (long)_profiler.Elapsed.TotalMilliseconds - StartMilliseconds; if (!Data.ContainsKey("readStart")) { Data["readStart"] = DurationMilliseconds.ToString(CultureInfo.InvariantCulture); } _profiler.GetTimingSession().AddTiming(this); }
/// <summary> /// Stops the current <see cref="ProfilingStep"/> and adds the <see cref="ProfilingStep"/> to profiler. /// </summary> /// <param name="addToProfiler"> /// Whether or not add the current <see cref="ProfilingStep"/> to profiler when stops. /// </param> public void Stop(bool addToProfiler) { if (!_isDiscarded && !_isStopped) { DurationMilliseconds = (long)_profiler.Elapsed.TotalMilliseconds - StartMilliseconds; _isStopped = true; ProfilingSession.ProfilingSessionContainer.CurrentSessionStepId = ParentId; if (addToProfiler) { _profiler.GetTimingSession().AddTiming(this); } } }
/// <summary> /// Stops the timing. /// </summary> public void Stop() { DurationMilliseconds = (long)_profiler.Elapsed.TotalMilliseconds - StartMilliseconds; _profiler.GetTimingSession().AddTiming(this); }