// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; namespace E { public class MainClass { public static double Speed(string url) { WebClient wc = new WebClient(); DateTime dt1 = DateTime.Now; byte[] data = wc.DownloadData(url); DateTime dt2 = DateTime.Now; return (data.Length * 8) / (dt2 - dt1).TotalSeconds; } public static void Main(string[] args) { Console.WriteLine("speed to somewhere in Bahrain = " + Speed("http://www.inetsupport.com.bh/meter/initialmeter.php")/1000 + " Kbit/s"); } } }