Ejemplo n.º 1
0
        public static ChartData ConductAnExperiment(
            IBenchmark benchmark, int repetitionsCount, ITaskFactory taskFactory, string title)
        {
            var classesTimes    = new List <ExperimentResult>();
            var structuresTimes = new List <ExperimentResult>();

            foreach (var size in Constants.FieldCounts)
            {
                classesTimes.Add(new ExperimentResult(size,
                                                      (benchmark.MeasureDurationInMs(taskFactory.CreateNewTask(size, "Class"), repetitionsCount))));
                structuresTimes.Add(new ExperimentResult(size,
                                                         benchmark.MeasureDurationInMs(taskFactory.CreateNewTask(size, "Structure"), repetitionsCount)));
            }
            return(new ChartData
            {
                Title = title,
                ClassPoints = classesTimes,
                StructPoints = structuresTimes,
            });
        }