title: Why is System.nanoTime() way slower (in performance) than System.currentTimeMillis()?
body: <p>Today I did a little quick Benchmark to test speed performance of <code>System.nanoTime()</code> and <code>System.currentTimeMillis()</code>:</p>
  
  <pre><code>long startTime = System.nanoTime();
  
  for(int i = 0; i &lt; 1000000; i++) {
    long test = System.nanoTime();
  }
  
  long endTime = System.nanoTime();
  
  System.out.println("Total time: "+(endTime-startTime));
  </code></pre>
  
  <p>This are the results:</p>
  
  <pre><code>System.currentTimeMillis(): average of 12.7836022 / function call
  System.nanoTime():          average of 34.6395674 / function call
  </code></pre>
  
  <p>Why are the differences in running speed so big?</p>
  
  <p>Benchmark system:</p>
  
  <pre><code>Java 1.7.0_25
  Windows 8 64-bit
  CPU: AMD FX-6100
  </code></pre>