title: Measuring Execution Time For Multithreaded Java Application
body: <p>I've searched about measuring execution time for Java application and I get this code:</p>
  
  <pre><code>long start= System.currentTimeMillis();
  //TODO
  long stop= System.currentTimeMillis();
  </code></pre>
  
  <p>Difference between start and stop gives me the execution time.</p>
  
  <p>NOTE: I'm aware of this is not the EXACT execution time. I just need the time for comparison between multithread and single thread applications.</p>
  
  <p>What if I change my code like this:</p>
  
  <pre><code>long start= System.currentTimeMillis();
  //something...
  Thread t1= new Thread(new blabla(0, 10), "T - 1");
  t1.start();
  Thread t2= new Thread(new blabla(10, 20), "T - 2");
  t2.start();
  //Consider I've 10 threads like this
  //something more
  long stop = System.currentTimeMillis();
  </code></pre>
  
  <p>10 thread executes. Doesn't matter what they do. Let's say they're randomly filling up a 2D array.</p>
  
  <p>Now, stop - start gives me the "whole" execution time? Or do I have to measure threads by themselves?</p>