static void Main(string[] args) { param = new YahooDownloadParam(args); var watch = Stopwatch.StartNew(); watch.Start(); //YahooCsvDownloader.StartDownload(param); //watch.Stop(); //Console.WriteLine(watch.ElapsedMilliseconds / 1000.0); //Console.WriteLine("Download Complete!"); watch.Restart(); YahooCsvDownloader.BatchDownloadFiles(param.GetUrls()).Wait(); watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds / 1000.0); Console.WriteLine("Download Complete!"); }
public static void StartDownload(YahooDownloadParam param) { Parallel.ForEach(param.GetUrls(), new ParallelOptions { MaxDegreeOfParallelism = ParallelCapacity }, DownloadFile); }