Пример #1
0
        private void executeSync_Click(object sender, RoutedEventArgs e)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            //var results = DemoMethods.RunDownloadSync();
            var results = DemoMethods.RunDownloadParallelSync();

            PrintResults(results);

            watch.Stop();
            var elaspedMs = watch.ElapsedMilliseconds;

            resultsWindow.Text += $"Total execution time: {elaspedMs}";
        }
Пример #2
0
        private async void Button_Async_Progress_Click(object sender, RoutedEventArgs routedEventArgs)
        {
            asyncBtnAndProgress.IsEnabled = false;
            Progress <ProgressReportModel> progress = new Progress <ProgressReportModel>();

            progress.ProgressChanged += UpdateDefaultStyle;
            var sw = new Stopwatch();

            sw.Start();
            var result = DemoMethods.RunDownloadParallelSync();

            sw.Stop();
            output.Text += $"Total time: " + sw.Elapsed;


            asyncBtnAndProgress.IsEnabled = true;
        }