public void Example_BenchmarkerWrappingExerciser() { //Benchmarker wrapping exerciser var benchmarkResult = NewRelicGuidGeneratorBenchmark.Execute(); Assert.AreEqual(NewRelicGuidGeneratorBenchmark.CountUowTotal, benchmarkResult.CountUnitsOfWorkExecuted_Mean); Assert.LessOrEqual(1000, benchmarkResult.Duration_Mean_Nanoseconds); }
public void Example_CompareTwoBenchmarks() { var guidResult = NewRelicGuidGeneratorBenchmark.Execute(); var referenceResult = StandardGuidBenchmark.Execute(); var comparer = BenchmarkResultComparer.Create(guidResult, referenceResult); // the time it takes to generate 1000 guids on 10 threads should never run longer than 4x // the time it takes to generate 1000 strings on 10-threads should never run mmor Assert.Less(comparer.Duration_Mean_Nanoseconds_Ratio, 4); }