问题
Using PHP if I load the URL http://www.cars.com with Curl then use curl_getinfo() to find the total time it takes to load... Will it calculate the load time including all images, and anything else displayed on the page. Or just the HTML (or whatever) file that is located at http://www.cars.com ?
curl_getinfo($ch, CURLINFO_TOTAL_TIME);
回答1:
If you load a HTML page with cURL, it's just going to load the page itself, not any linked resources like images.
Particularly, it's not going to give you a good idea of how long it would take someone using a Web browser to load the page.
回答2:
use Apache benchmark if you really want a load test to compensate for ups/downs in cpu usage
回答3:
No, CURLINFO_TOTAL_TIME will give you the transfer time for the cars.com page. Curl is not a browser and will not load images, javascript etc.
Both Chrome and Firefox (via Firebug) will happily report this for you.
来源:https://stackoverflow.com/questions/3417484/using-curl-for-load-time-testing-php