views:

67

answers:

3

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  A: 

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.

zerocrates
What if you load the HTML page then load all the linked resources and add the total times together?
Mark
Even if you wanted to or could do that, it'd be a bad idea. Even if you parse out and load every link, you still don't account for things like delays for styling and script execution. I'd follow some of the other advice here and either rethink your requirements, or use a tool more suited to the task.
zerocrates
A: 

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.

matiasf
+1  A: 

use Apache benchmark if you really want a load test to compensate for ups/downs in cpu usage

stillstanding