static TimeSpan InvokeStoredProcedure() { Stopwatch stopwatch = new Stopwatch(); TimeSpan timeUsedToGetFromStoredProcedure; VehicleServiceDataAccess vehicleData = new VehicleServiceDataAccess(); List <uspVehicleServiceComplete> resultFromStoredProcedure; ///Measure time used to get data from the Stored Procedure stopwatch.Start(); resultFromStoredProcedure = vehicleData.GetDataFromStoredProcedure(); stopwatch.Stop(); timeUsedToGetFromStoredProcedure = stopwatch.Elapsed; stopwatch.Reset(); return(timeUsedToGetFromStoredProcedure); }
static TimeSpan InvokeView() { Stopwatch stopwatch = new Stopwatch(); TimeSpan timeUsedToGetFromView; VehicleServiceDataAccess vehicleData = new VehicleServiceDataAccess(); List <VehicleServiceComplete> resultFromView; ///Measure time used to get data from the View stopwatch.Start(); resultFromView = vehicleData.GetDataFromView(); stopwatch.Stop(); timeUsedToGetFromView = stopwatch.Elapsed; stopwatch.Reset(); return(timeUsedToGetFromView); }