コード例 #1
0
        public static long GetAverageCallTime(ICustomerTasks customerTasks, int numberOfCallsToMake)
        {
            long totalMilliseconds = 0;

            for (int index = 0; index < numberOfCallsToMake; index++)
            {
                totalMilliseconds += GetCallTime(customerTasks);
            }

            return totalMilliseconds / numberOfCallsToMake;
        }
コード例 #2
0
        private static long GetCallTime(ICustomerTasks customerTasks)
        {
            var callStopwatch = new Stopwatch();

            callStopwatch.Start();

            customerTasks.DoTask();

            callStopwatch.Stop();

            return callStopwatch.ElapsedMilliseconds;
        }
コード例 #3
0
ファイル: CustomersController.cs プロジェクト: seif/Northwind
 public CustomersController(ICustomerTasks customerTasks)
 {
     this.customerTasks = customerTasks;
 }
コード例 #4
0
 public CustomersController(ICustomerTasks customerTasks)
 {
     this.customerTasks = customerTasks;
 }
コード例 #5
0
 //
 // GET: /Customer/
 public CustomerController(ICustomerTasks customerTasks, ICommandProcessor commandProcessor)
 {
     CustomerTasks = customerTasks;
     CommandProcessor = commandProcessor;
 }