I'm using PHP Curl to measure download times for a webpage. I know this isn't a good representation of actual download times for a browser; but I'm trying to get as close as possible using this method.
My webpage has 3 files associated with it
- index.html
- my_pic.gif
- style.css
I'm doing a Curl on each of those files then adding the download times together to get the total download time.
My question is how should I do the calculations to get as close as possible to simulating a browser download?
The Curl options for measuring download times are:
CURLINFO_TOTAL_TIME
CURLINFO_NAMELOOKUP_TIME
CURLINFO_CONNECT_TIME
CURLINFO_PRETRANSFER_TIME
CURLINFO_STARTTRANSFER_TIME
Would a browser go through all of those steps for each of the 3 files above?
For Example:
Let's say I do a CURLINFO_TOTAL_TIME on index.html.
Should I also do a CURLINFO_TOTAL_TIME on my_pic.gif and style.css? Then add those numbers to the CURLINFO_TOTAL_TIME on index.html.
OR
Should I do a CURLINFO_TOTAL_TIME minus CURLINFO_STARTTRANSFER_TIME on my_pic.gif and style.css? Then add those numbers to the CURLINFO_TOTAL_TIME on index.html.