Ejemplo n.º 1
0
        public void MeasureMinOverhead_Random()
        {
            int min   = 3;
            var timer = new RandomStepTimer(17, 3, 42);

            var m = TimerMeasurer.MeasureOverhead(timer);

            Assert.Equal(min, m.Value);
        }
Ejemplo n.º 2
0
        public void MeasurePrecision_Random()
        {
            int min          = 3;
            int max          = 42;
            var timer        = new RandomStepTimer(17, min, max);
            var measurements = new Ticks[53];

            TimerMeasurer.MeasurePrecision(timer, new ArraySegment <Ticks>(measurements));

            foreach (var m in measurements)
            {
                Assert.InRange(m.Value, min, max);
            }
        }