public TimingInfo(string name, Histogram histogram, int iterations, DateTime startTime)
 {
     _name = name;
     _histogram = histogram;
     _iterations = iterations;
     _startTime = startTime;
 }
 public static TimingInfo BenchmarkOperation(int iterations, Action<int> action, string messagePrefix = "")
 {
     var startTime = DateTime.UtcNow;
     var min = TimeSpan.MaxValue;
     var max = TimeSpan.MinValue;
     var hist = new Histogram(50000000, 5);
     for (var x = 0; x < iterations; x++)
     {
         var sw = Stopwatch.StartNew();
         action(x);
         sw.Stop();
         hist.recordValue(sw.ElapsedTicks/10);
     }
     
     return new TimingInfo(messagePrefix, hist, iterations, startTime);
 }
示例#3
0
 public override /*Histogram*/ AbstractHistogram copyCorrectedForCoordinatedOmission(/*final*/ long expectedIntervalBetweenValueSamples) 
 {
     Histogram toHistogram = new Histogram(lowestTrackableValue, highestTrackableValue, numberOfSignificantValueDigits);
     toHistogram.addWhileCorrectingForCoordinatedOmission(this, expectedIntervalBetweenValueSamples);
     return toHistogram;
 }
示例#4
0
 public override /*Histogram*/ AbstractHistogram copy() 
 {
     Histogram copy = new Histogram(lowestTrackableValue, highestTrackableValue, numberOfSignificantValueDigits);
     copy.add(this);
     return copy;
 }