public IResult[] Execute(ITimes times, IParallelism parallelism) { IInstance[] input = this.instances; while (true) { Log.Information("Executing {Case} {Times}", [email protected], times.Describe()); MinDurationVisitor visitor = new MinDurationVisitor(); IResult[] results = parallelism.Execute(input, times); foreach (IResult result in results) { result.Data.Visit(visitor); } if (visitor.HasValue() == false || visitor.GetValue().TotalSeconds >= 1.0d) { return(results); } double ceiling = Math.Ceiling(1.2d / visitor.GetValue().TotalSeconds); times = times.Multiply(Math.Max(2, (int)ceiling)); input = OptimizeOrder(results); } }
public IResult[] Execute(ITimes times, IParallelism parallelism) { IInstance[] input = this.instances; while (true) { Log.Information("Executing {Case} {Times}", [email protected], times.Describe()); MinDurationVisitor visitor = new MinDurationVisitor(); IResult[] results = parallelism.Execute(input, times); foreach (IResult result in results) { result.Data.Visit(visitor); } if (visitor.HasValue() == false || visitor.GetValue().TotalSeconds >= 1.0d) { return results; } double ceiling = Math.Ceiling(1.2d / visitor.GetValue().TotalSeconds); times = times.Multiply(Math.Max(2, (int)ceiling)); input = OptimizeOrder(results); } }