public void CalculateFpsWithStopwatch() { time = new StopwatchTime(); const int TargetFps = 30; do { Thread.Sleep(1000 / TargetFps); time.Update(); } while (time.Milliseconds < 1000); Assert.IsTrue(Math.Abs(time.Fps - TargetFps) <= 5, "Fps=" + time.Fps); }
public void Dispose() { Current = null; }
protected GlobalTime() { Current = this; SetFpsTo60InitiallyAndSetUsefulInitialValues(); }
public void RunTimeWithStopwatch() { time = new StopwatchTime(); time.Update(); Assert.IsTrue(time.Milliseconds < 2, "Milliseconds=" + time.Milliseconds); }