private static long GetRunTimeForSolution(MaxConsecRedNotPoisoned.Methods method, List <Apple> apples) { var stopwatch = new Stopwatch(); stopwatch.Start(); new MaxConsecRedNotPoisoned(apples, method); stopwatch.Stop(); return(stopwatch.ElapsedMilliseconds); }
private static decimal GetAvgTimeForSolution(MaxConsecRedNotPoisoned.Methods method, List <Apple> apples, int runs) { long sum = 0; for (int i = 0; i < runs; i++) { sum += GetRunTimeForSolution(method, apples); } return(sum / runs); }