Exemplo n.º 1
0
 public void TestChangesOnUpdate()
 {
     HPTimer timer = new HPTimer();
     timer.Start();
     long ms = timer.TimeInMilliseconds;
     long ticks = timer.Ticks;
     // sleep for at least for 100 rounds of ticks
     Thread.Sleep((int)Math.Max(5, 100 * 1000 / timer.Frequency));
     timer.Update();
     Assert.Less(ms, timer.TimeInMilliseconds);
     Assert.Less(ticks, timer.Ticks);
     Assert.Greater(timer.Frequency / (100 * 1000), timer.ElapsedInMilliseconds);
 }