use .net's Stopwatch instead of sdl's broken timer

This commit is contained in:
Bob
2010-04-09 14:51:56 +12:00
parent d53212ff00
commit 4f9fb8f08d

View File

@@ -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();
}
}
}