public static long GetAverageCallTime(ICustomerTasks customerTasks, int numberOfCallsToMake) { long totalMilliseconds = 0; for (int index = 0; index < numberOfCallsToMake; index++) { totalMilliseconds += GetCallTime(customerTasks); } return totalMilliseconds / numberOfCallsToMake; }
private static long GetCallTime(ICustomerTasks customerTasks) { var callStopwatch = new Stopwatch(); callStopwatch.Start(); customerTasks.DoTask(); callStopwatch.Stop(); return callStopwatch.ElapsedMilliseconds; }
public CustomersController(ICustomerTasks customerTasks) { this.customerTasks = customerTasks; }
// // GET: /Customer/ public CustomerController(ICustomerTasks customerTasks, ICommandProcessor commandProcessor) { CustomerTasks = customerTasks; CommandProcessor = commandProcessor; }