Browse Source

Clean up render timers to use Environment.TickCount.

pull/1715/head
Jeremy Koritzinsky 8 years ago
parent
commit
5e1e25e6fa
  1. 2
      src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs
  2. 2
      src/Windows/Avalonia.Win32/RenderTimer.cs

2
src/Avalonia.Visuals/Rendering/DefaultRenderTimer.cs

@ -85,7 +85,7 @@ namespace Avalonia.Rendering
_runtime = AvaloniaLocator.Current.GetService<IRuntimePlatform>(); _runtime = AvaloniaLocator.Current.GetService<IRuntimePlatform>();
} }
return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Stopwatch.GetTimestamp())); return _runtime.StartSystemTimer(TimeSpan.FromSeconds(1.0 / FramesPerSecond), () => tick(Environment.TickCount));
} }
/// <summary> /// <summary>

2
src/Windows/Avalonia.Win32/RenderTimer.cs

@ -34,7 +34,7 @@ namespace Avalonia.Win32
EnsureTimerQueueCreated(); EnsureTimerQueueCreated();
var msPerFrame = 1000 / FramesPerSecond; var msPerFrame = 1000 / FramesPerSecond;
timerDelegate = (_, __) => tick(TimeStampToFrames()); timerDelegate = (_, __) => tick(Environment.TickCount);
UnmanagedMethods.CreateTimerQueueTimer( UnmanagedMethods.CreateTimerQueueTimer(
out var timer, out var timer,

Loading…
Cancel
Save