Report() public method

Adds the current value to the statistics.
public Report ( double current ) : void
current double The current value.
return void
Example #1
0
        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;
        }
Example #2
0
        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;
        }