title: java System.nanoTime is really slow. Is it possible to implement a high performance java profiler?
body: <p>I did a test and found the overhead of a function call to System.nanoTime() is at least 500 ns on my machine. </p>
  
  <p>Seemed that it is very hard to have a high performance java profiler.
  For enterprise software, suppose a function takes about 350 seconds and has 12,500,000,000 times of method calls. Therefore, the number of calls to System.nanoTime() is:
  12,500,000,000 * 2 = 25,000,000,000 (one for start timestamp, one for end timestamp)
  And the overhead of System.nanoTime in total is:
  500 ns * 25,000,000,000 = 500 * 25000 s = 12500000s.</p>
  
  <p>Note: all data from real case.</p>
  
  <p>Any better way to acquire the timestamp?</p>