Ejemplo n.º 1
0
        public static async Task ExecuteAsyncDownload(List <Time> time)
        {
            Console.WriteLine("\n===================");
            Console.WriteLine("Downloading Files: ");
            Console.WriteLine("===================");

            var watch = System.Diagnostics.Stopwatch.StartNew();

            foreach (Time t in time)
            {
                Console.Write($"Downloading WikiDump of {t.Year}-{t.Month}-{t.Day}-{t.Hour}... ");

                await DownloadAsyncUrl(GetUri(t.Year, t.Month, t.Day, t.Hour), FileDirectory.GetZippedFile(t.Year, t.Month, t.Day, t.Hour));

                Console.Write("Done!\n");
            }

            watch.Stop();

            var elapsedMs = watch.ElapsedMilliseconds;

            Console.WriteLine("Download Completed!");
            Console.WriteLine($"Total Execution Time: { elapsedMs }");
        }