Преглед на файлове

Stopwatch Restart() now returns elapsed milliseconds

Kenric Nugteren преди 2 години
родител
ревизия
005d0880f0
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 6 1
      InABox.Core/Profiler.cs

+ 6 - 1
InABox.Core/Profiler.cs

@@ -25,7 +25,12 @@ namespace InABox.Core
         public long GetElapsedMilliseconds() => _stopwatch.ElapsedMilliseconds;
         public void Pause() => _stopwatch.Stop();
         public void Resume() => _stopwatch.Start();
-        public void Restart() => _stopwatch.Restart();
+        public long Restart()
+        {
+            var ms = _stopwatch.ElapsedMilliseconds;
+            _stopwatch.Restart();
+            return ms;
+        }
 
         public void Log()
         {