code 2
//metroLabel16.Text = "Running";
System.Net.WebClient wc = new System.Net.WebClient();
//DateTime Variable To Store Download Start Time.
DateTime dt1 = DateTime.Now;
//Number Of Bytes Downloaded Are Stored In ‘data’
byte[] data = wc.DownloadData("https://github.com/harshityadav95/static-file-storage/blob/master/text.txt");
//DateTime Variable To Store Download End Time.
DateTime dt2 = DateTime.Now;
//To Calculate Speed in Kb Divide Value Of data by 1024 And Then by End Time Subtract Start Time To Know Download Per Second.
double r = Math.Round((dt2 - dt1).TotalSeconds, 2);
// double r = (data.Length / 1024) / (dt2 - dt1).TotalSeconds;
// Download code freeze
return r;