/// <summary> /// Increments the currently running <see cref="MiniProfiler.Stopwatch"/> by <paramref name="milliseconds"/>. /// </summary> /// <param name="profiler">The profile to increment.</param> /// <param name="milliseconds">The milliseconds.</param> public static void Increment(this MiniProfiler profiler, int milliseconds = BaseTest.StepTimeMilliseconds) { var sw = (UnitTestStopwatch)profiler.GetStopwatch(); sw.ElapsedTicks += milliseconds * UnitTestStopwatch.TicksPerMillisecond; }
private void ProfilerStopped(MiniProfiler profiler, bool discard) { if (_profilers.TryRemove(profiler.Id, out _)) { OnProfilerStopped?.Invoke(this, new ProfilerStoppedEvent(profiler.Id, new TimeSpan(profiler.GetStopwatch().ElapsedTicks), profiler)); } }