title: More accurate function execution time out of a shared "noise" computer?
body: <p>I am doing benchmark on a "supercomputer" (not a literal one but a computer stuff with tons of ram and cpu). </p>
  
  <p>The problem is the computer is shared by many people.</p>
  
  <p>Is any measure to obtain a more accurate measurement of functional execution time (written in C)</p>
  
  <p>Or can I measure the "background" noise and discount it from the measurement?  </p>
  
  <p>My current scheme is to use the function in 
  <a href="http://nadeausoftware.com/articles/2012/03/c_c_tip_how_measure_cpu_time_benchmarking" rel="nofollow noreferrer">http://nadeausoftware.com/articles/2012/03/c_c_tip_how_measure_cpu_time_benchmarking</a></p>
  
  <p>It uses POSIX timer to get cpu time, but I find this still still affected by the "background noise" of the computer</p>
  
  <p>scenario:
  I reimplement the sorting routine in SQLite with linear time sorting function. I tried to benchmark it in the in-memory database of SQLite. Every Time I insert 5 million rows of random record, I execute an "order by" query (sorted by random 64-bit integer), and only time the query time. And below is the result. You can observe, there a lot of sudden sharp drop on the graph.</p>
  
  <p><img src="https://i.imgur.com/C1aU1x6.png" alt="benchmark"></p>