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;
}