title: logging round-trip load times of requests
body: <p>I am using a testscript to measure the round-trip times of a test page.
  I dont need the measured time to be accurate, I just want the trend to be stable so i can see the increase in load times under high(er) load.</p>
  
  <p>For this I use 2 methods (in javascript) to measure the loadtime.</p>
  
  <p>1:</p>
  
  <pre><code>var start_time = (new Date).getTime();
  //load the resource
  var end_time = (new Date).getTime() - start_time;
  </code></pre>
  
  <p>2:</p>
  
  <pre><code>var time_passed = 0;
  var timer = setInterval("time_passed += 10;", 10);
  //load the resource
  clearInterval(timer);
  </code></pre>
  
  <p>I have read that the resolution of the first method is low in most browsers,
  the only browser who gives a "good" result is chrome</p>
  
  <p>the second method is very stable across browsers and gives a constant result.</p>
  
  <p>The measured times are, as was to be expected, very irregular for the date difference, and very stable for the interval timer.
  My problem however is that i removed the date difference timer because it was unusable, once i removed it the interval measurements became very unstable. The measured times peak under and above the trend.</p>
  
  <p>Can anyone explain why the interval is unstable once the date difference is removed.</p>
  
  <p>And/or maby how to improve on the timing.</p>