소스 검색

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()
         {