用c#我下載文件與webclient作爲字符串以檢查下載速度,我怎麼能用javascript或PHP做到這一點? 這是我的c#示例。如何使用javascript或php下載文件爲字符串作爲speedtest?
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;
謝謝...
[你有什麼嘗試?](http://www.whathaveyoutried.com/)你可以發佈一些代碼? – Cerbrus