Java - Big result difference when benchmarking an algorithm in ms and ns
<p>I was performing some test performance on an algorithm and noticed something weird. Maybe I am missing something here.</p>

<p>I first measure the time in milliseconde:</p>

<pre><code>long startTime = System.currentTimeMillis();
x.sort(sortStringInput);
long endTime = System.currentTimeMillis();
</code></pre>

<p>and then in nanoseconde:</p>

<pre><code>long startTime = System.nanoTime();
x.sort(sortStringInput);
long endTime = System.nanoTime();
</code></pre>

<p>The results are 437ms qnd 26366ns.</p>

<p>I am calling the same method so how can it be possible to get a result in ns which is way smaller than the one in ms. I know that 1 ms is 1 000 000 ns so 26366 is even smaller than 1 ms...</p>

<p>Thanks,</p>
