Getting Execution time in Multithreaded program
<p>I am trying to sort an array using multithreading in java and note its execution time. I am using System.nanoTime() for the same.</p>

<p>Here is a template of the code</p>

<pre><code>start = System.nanoTime();
sort();   // calls different threads to completely sort the array
end = System.nanoTime()
</code></pre>

<p>What I want to ask is that the above is in main Thread so will it give me incorrect time results given that I did not put main.sleep() ?? or is it handled by the JVM . Also if I am in need of fast execution is there something that can improve the performance of above code in terms of time execution??</p>
