From 5e1e25e6fa8a17e7ead7c55b1b0b17b73b0fbb05 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Thu, 6 Sep 2018 17:31:05 -0500 Subject: [PATCH] Clean up render timers to use Environment.TickCount. --- src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs | 2 +- src/Windows/Avalonia.Win32/RenderTimer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs b/src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs index b05ecd5456..a83334ff5e 100644 --- a/src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs +++ b/src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs @@ -85,7 +85,7 @@ namespace Avalonia.Rendering _runtime = AvaloniaLocator.Current.GetService(); } - return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Stopwatch.GetTimestamp())); + return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Environment.TickCount)); } /// diff --git a/src/Windows/Avalonia.Win32/RenderTimer.cs b/src/Windows/Avalonia.Win32/RenderTimer.cs index 0cb107d3a9..c911bc3adf 100644 --- a/src/Windows/Avalonia.Win32/RenderTimer.cs +++ b/src/Windows/Avalonia.Win32/RenderTimer.cs @@ -34,7 +34,7 @@ namespace Avalonia.Win32 EnsureTimerQueueCreated(); var msPerFrame = 1000 / FramesPerSecond; - timerDelegate = (_, __) => tick(TimeStampToFrames()); + timerDelegate = (_, __) => tick(Environment.TickCount); UnmanagedMethods.CreateTimerQueueTimer( out var timer,