Namespace: DeltaEngine.Core
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Core.GlobalTimeTests
3 unit tests call DeltaEngine.Core.GlobalTime.Fps
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: Int32Remarks
Examples
[Test] public void CalculateFps() { do time.Update(); while (time.Milliseconds <= 1000); Assert.IsTrue(Math.Abs(time.Fps - 20) <= 1, "Fps=" + time.Fps); }
[Test] public void FpsShouldBeSixty() { Assert.AreEqual(60, GlobalTime.Current.Fps); }
[Test, Ignore] 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); }
See Also