Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/07/2009, 17:06
Avatar de Peterpay
Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Respuesta: Velocidad de Navegacion en Internet

Para la velocidad de descarga prueba algo como esto

Código csharp:
Ver original
  1. const string tempfile = "tempfile.tmp";
  2. System.Net.WebClient webClient = new System.Net.WebClient();
  3. Console.WriteLine("Downloading file....");
  4. System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
  5. webClient.DownloadFile("http://dl.google.com/googletalk/googletalk-setup.exe", tempfile);
  6. sw.Stop();
  7. FileInfo fileInfo = new FileInfo(tempfile);
  8. long speed = fileInfo.Length / sw.Elapsed.Seconds;
  9.  Console.WriteLine("Download duration: {0}", sw.Elapsed);
  10. Console.WriteLine("File size: {0}", fileInfo.Length.ToString("N0"));
  11. Console.WriteLine("Speed: {0} bps ", speed.ToString("N0"));
  12. Console.WriteLine("Press any key to continue...");
  13. Console.ReadLine();

lo pongo en c# porq no especificaste
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5