title: Measuring Site Load Times via performance api
body: <p>I listened to a talk by Steve Souders a few days ago and he mentioned the new performance spec that newer browsers are implementing and it was pretty intriguing.  In his speech he mentioned the following example as a means of measuring perceived page load time:</p>
  
  <pre><code>var timing = performance.timing;
  var loadtime = timing.loadEventEnd - timing.navigationStart;
  alert("Perceived time:"+loadtime);
  </code></pre>
  
  <p>Clearly this is a basic example, but when trying it on my development environment, I get crazy numbers like -1238981729837 as the answer because loadEventEnd is &lt; 0.</p>
  
  <p>Obviously something is amiss and there are many improvements that can be made to this example to give more information and produce a greater reliability.  (I am aware this is only implemented in a few browsers).  </p>
  
  <p>So, what are some suggestions on how to use this api to track page load times via Javascript for analysis of my site performance?</p>