示例#1
0
        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!");
        }
示例#2
0
 public static void StartDownload(YahooDownloadParam param)
 {
     Parallel.ForEach(param.GetUrls(), new ParallelOptions {
         MaxDegreeOfParallelism = ParallelCapacity
     }, DownloadFile);
 }