Exemplo n.º 1
0
 public static PageResultMessage Worker(GetPageMessage message)
 {
     var client = new WebClient();
     var stopwatch = new Stopwatch();
     stopwatch.Start();
     var page = client.DownloadString(message.Url);
     stopwatch.Stop();
     return new PageResultMessage
     {
         Size = page.Length,
         Milliseconds = stopwatch.ElapsedMilliseconds,
         Url = message.Url,
         ThreadId = Thread.CurrentThread.ManagedThreadId
     };
 }
Exemplo n.º 2
0
        public static PageResultMessage Worker(GetPageMessage message)
        {
            var client    = new WebClient();
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            var page = client.DownloadString(message.Url);

            stopwatch.Stop();
            return(new PageResultMessage
            {
                Size = page.Length,
                Milliseconds = stopwatch.ElapsedMilliseconds,
                Url = message.Url,
                ThreadId = Thread.CurrentThread.ManagedThreadId
            });
        }