private Stats Benchmark_ReportIndividualIterations(int numberOfIterations, Stats stats) { for (int i = 0; i < numberOfIterations; i++) { Stopwatch stopwatch = Stopwatch.StartNew(); Action.Invoke(); stopwatch.Stop(); stats.Report(stopwatch.ElapsedMilliseconds); } return stats; }
private Stats Benchmark(int numberOfIterations, Stats stats) { Stopwatch stopwatch = Stopwatch.StartNew(); for (int i = 0; i < numberOfIterations; i++) { Action.Invoke(); } stopwatch.Stop(); stats.Report(stopwatch.ElapsedMilliseconds); stats.TotalIterations = numberOfIterations; stats.Min = stats.Max = stats.Average; return stats; }