浏览代码

Use `Stopwatch.GetTimestamp()` for tickCount.

Steven Kirk 7 年之前
父节点
当前提交
c7c9b0a205
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs

+ 2 - 1
src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs

@@ -2,6 +2,7 @@
 // Licensed under the MIT license. See licence.md file in the project root for full license information.
 
 using System;
+using System.Diagnostics;
 using System.Threading.Tasks;
 using Avalonia.Platform;
 
@@ -84,7 +85,7 @@ namespace Avalonia.Rendering
                 _runtime = AvaloniaLocator.Current.GetService<IRuntimePlatform>();
             }
 
-            return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Environment.TickCount));
+            return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Stopwatch.GetTimestamp()));
         }
 
         /// <summary>