With c# I download files with webclient as string in order to check download speed, how can I do this with javascript or PHP?
Here is my c# sample.
Uri URL = new Uri("https://www.example.com/File512kb");
WebClient wc = new WebClient();
double starttime = Environment.TickCount;
string file = wc.DownloadString(URL); //download this file as string so I won't need to save it to local disk.
stopWatch.Elapsed.Milliseconds;
double endtime = Environment.TickCount;
double milisecs = endtime - starttime;
Thanks…
JavaScript:
This returns the time passed in milliseconds. The function does use jQuery, however, since that’s a nice’n easy way to make AJAX calls.