public async Task <BenchClass> BenchmarkAndExecuteTaskAsync(Action TaskReference, TaskParams executionQuery) { BenchClass returnBenchResult = new BenchClass(); returnBenchResult.executionTimeInMilliseconds = (await BenchmarkAndExecuteTaskAsync <int>(TaskConverters.ConvertToActionToTask <int>(TaskReference), executionQuery)).executionTimeInMilliseconds; return(returnBenchResult); }
public async Task <BenchClass <T> > BenchmarkAndExecuteTaskAsync <T>(Func <Task <T> > TaskReference, TaskParams executionQuery) { DateTime startTime = DateTime.Now; var OperationResult = await ExecuteTaskAsync <T>(TaskReference, executionQuery); DateTime endTime = DateTime.Now; BenchClass <T> BenchmarkResult = new BenchClass <T>(); BenchmarkResult.executionTimeInMilliseconds = (endTime - startTime).TotalMilliseconds; BenchmarkResult.OperationResult = OperationResult; return(BenchmarkResult); }