Example #1
0
        public void MeasureTimerOverhead_Stopwatch()
        {
            var minDiff = TimerMeasurer.MeasureOverhead(new StopwatchTimer());

            // The call to Now itself takes time so precision is often many ticks e.g. 100
            _output.WriteLine(minDiff.ToString());
        }
        public void MeasureMinOverhead_Random()
        {
            int min   = 3;
            var timer = new RandomStepTimer(17, 3, 42);

            var m = TimerMeasurer.MeasureOverhead(timer);

            Assert.Equal(min, m.Value);
        }
        public void MeasureMinOverhead_ConstantStep()
        {
            long step  = 17;
            var  timer = new ConstantStepTimer()
            {
                Step = step
            };

            var m = TimerMeasurer.MeasureOverhead(timer);

            Assert.Equal(step, m.Value);
        }