Quellcode durchsuchen

Stopwatch Restart() now returns elapsed milliseconds

Kenric Nugteren vor 2 Jahren
Ursprung
Commit
005d0880f0
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  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()
         {