コード例 #1
0
ファイル: TPL.cs プロジェクト: WinDevInd/WinTPL
        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);
        }
コード例 #2
0
ファイル: TPL.cs プロジェクト: WinDevInd/WinTPL
        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);
        }