private void AutoTest(Frequency clockFrequency, TimeInterval operationTime, double maxStdErrRelative, long minInvokeCount)
 {
     var job = new Job
     {
         Infrastructure = { Clock = new MockClock(clockFrequency) },
         Accuracy = { MaxStdErrRelative = maxStdErrRelative }
     }.Freeze();
     var stage = CreateStage(job, data => data.InvokeCount * operationTime);
     long invokeCount = stage.Run();
     output.WriteLine($"InvokeCount = {invokeCount} (Min= {minInvokeCount}, Max = {MaxPossibleInvokeCount})");
     Assert.InRange(invokeCount, minInvokeCount, MaxPossibleInvokeCount);
 }
 public static HardwareTimerKind GetHardwareTimerKind(Frequency frequency)
 {
     long freqKHz = (long)Math.Round(frequency / Frequency.KHz);
     if (14300 <= freqKHz && freqKHz <= 14400)
         return HardwareTimerKind.Hpet;
     if (3579500 <= frequency && frequency <= 3579600)
         return HardwareTimerKind.Acpi;
     if (freqKHz == 10000)
         return HardwareTimerKind.Unknown;
     if (5 <= freqKHz && freqKHz < 4000)
         return HardwareTimerKind.Tsc;
     if (freqKHz <= 4)
         return HardwareTimerKind.System;
     return HardwareTimerKind.Unknown;
 }
Esempio n. 3
0
 public ClockSpan(long startTimestamp, long endTimestamp, Frequency frequency)
 {
     StartTimestamp = startTimestamp;
     EndTimestamp   = endTimestamp;
     Frequency      = frequency;
 }
 public MockClock(Frequency frequency)
 {
     Frequency = frequency;
 }