title: Is there a better way to benchmark a C program than timing?
body: <p>I'm coding a little program that has to sort a large array (up to 4 million text strings). Seems like I'm doing quite well at it, since a combination of radixsort and mergesort already cut the original q(uick)sort execution time in less than half.</p>
  
  <p><strong>Execution time</strong> being the main point, since this is what I'm using to <em>benchmark</em> my piece of code.</p>
  
  <p>My question is:</p>
  
  <p>Is there a better (i. e. more reliable) way of benchmarking a program than just time the execution? It kinda works, but the same program (with the same background processes running) usually has slightly different execution times if run twice.</p>
  
  <p>This kinda defeats the purpose of detecting small improvements. And several small improvements could add up to a big one...</p>
  
  <p>Thanks in advance for any input!</p>
  
  <p><strong>Results:</strong></p>
  
  <p>I managed to get gprof to work under Windows (using gcc and MinGW). gcc behaves poorly (considering execution time) compared to my normal compiler (tcc), but it gave me quite some insight.</p>