Ejemplo n.º 1
0
        /// <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;
        }
Ejemplo n.º 2
0
 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));
     }
 }