title: Explanation of window.performance javascript
body: <p>I am working on detecting the connection speed, so i planned to go with <a href="http://msdn.microsoft.com/en-us/library/ff975075">window.performance</a> object for duration calculation.</p>
  
  <p>I am little confused with window.performance.timing object is generated based on the whole page load, or based on the last request and response.</p>
  
  <p>For Example: </p>
  
  <p>I am having 5 server call for web page load, <code>performance.timing</code> object is generated based on all the 5 server calls or based on the 5th server call(last call).</p>
  
  <p><strong>sample connection speed calculation for reference</strong></p>
  
  <pre><code> var bitsLoaded = 100000; //bits total size of all files (5 server call).
   var duration = performance.timing.responseEnd - performance.timing.navigationStart;
   var speedBps = Math.round(bitsLoaded / duration);
   var speedKbps = (speedBps / 1024).toFixed(2);
   var speedMbps = (speedKbps / 1024).toFixed(2); 
  </code></pre>
  
  <p>Anything not clear ready to explain</p>
  
  <p>Any idea about window.performance</p>