Example #1
0
        private static StatsCollection TimeIt(int sampleCount, int iterationCount, IEnumerable <NamedAction> namedActions)
        {
            var collector = new StatsCollection();
            var logger    = new StatsLogger(collector);
            var timer     = new MultiSampleCodeTimer(sampleCount, iterationCount);

            timer.OnMeasure +=
                (name, iterations, scale, samples) => { logger.AddWithCount(name, iterations, scale, samples); };
            namedActions.ToList().ForEach(namedAction => timer.Measure(namedAction.Name, namedAction.TheAction));
            return(collector);
        }
Example #2
0
 public StatsLogger(StatsCollection dataSet)
 {
     this.dataSet = dataSet;
     attributes   = new Dictionary <string, object>();
 }