From 4f9fb8f08d504bb1cff5be1160df0c7de8229090 Mon Sep 17 00:00:00 2001 From: Bob Date: Fri, 9 Apr 2010 14:51:56 +1200 Subject: [PATCH] use .net's Stopwatch instead of sdl's broken timer --- OpenRA.FileFormats/Support/Stopwatch.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/OpenRA.FileFormats/Support/Stopwatch.cs b/OpenRA.FileFormats/Support/Stopwatch.cs index 75f2fd5cd2..7356e7b2f3 100755 --- a/OpenRA.FileFormats/Support/Stopwatch.cs +++ b/OpenRA.FileFormats/Support/Stopwatch.cs @@ -18,25 +18,24 @@ */ #endregion -using Tao.Sdl; namespace OpenRA.Support { public class Stopwatch { - int start; - public Stopwatch() + System.Diagnostics.Stopwatch sw; + public Stopwatch () { Reset(); } public double ElapsedTime() { - return (1.0/1000.0) * (double)(Sdl.SDL_GetTicks() - start); + return sw.Elapsed.TotalMilliseconds / 1000.0; } public void Reset() { - start = Sdl.SDL_GetTicks(); + sw = System.Diagnostics.Stopwatch.StartNew(); } } }