title: Calculating download times with PHP Curl
body: <p>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.</p>
  
  <p>My webpage has 3 files associated with it</p>
  
  <ol>
  <li>index.html</li>
  <li>my_pic.gif</li>
  <li>style.css</li>
  </ol>
  
  <p>I'm doing a Curl on each of those files then adding the download times together to get the total download time.</p>
  
  <p>My question is how should I do the calculations to get as close as possible to simulating a browser download?</p>
  
  <p>The Curl options for measuring download times are:</p>
  
  <pre><code>CURLINFO_TOTAL_TIME
  CURLINFO_NAMELOOKUP_TIME
  CURLINFO_CONNECT_TIME
  CURLINFO_PRETRANSFER_TIME
  CURLINFO_STARTTRANSFER_TIME
  </code></pre>
  
  <p>Would a browser go through all of those steps for each of the 3 files above?</p>
  
  <p>For Example:</p>
  
  <p>Let's say I do a CURLINFO_TOTAL_TIME on index.html.</p>
  
  <p>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.</p>
  
  <p>OR</p>
  
  <p>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.</p>