title: Calculating the speed of routines?
body: <p>What would be the best and most accurate way to determine how long it took to process a routine, such as a procedure of function?</p>
  
  <p>I ask because I am currently trying to optimize a few functions in my Application, when i test the changes it is hard to determine just by looking at it if there was any improvements at all. So if I could return an accurate or near accurate time it took to process a routine, I then have a more clear idea of how well, if any changes to the code have been made.</p>
  
  <p>I considered using GetTickCount, but I am unsure if this would be anything near accurate?</p>
  
  <p>It would be useful to have a resuable function/procedure to calculate the time of a routine, and use it something like this:</p>
  
  <pre><code>// &lt; prepare for calcuation of code
  ...
  ExecuteSomeCode; // &lt; code to test
  ...
  // &lt; stop calcuating code and return time it took to process
  </code></pre>
  
  <p>I look forward to hearing some suggestions.</p>
  
  <p>Thanks.</p>
  
  <p>Craig.</p>