title: How to time Java program execution speed
body: <p>How do you time the execution of a java program? I'm not sure what class I should use to do this.</p>
  
  <p>I'm kinda looking for something like:</p>
  
  <pre><code>// Some timer starts here
  for (int i = 0; i &lt; length; i++) {
    // Do something
  }
  // End timer here
  
  System.out.println("Total execution time: " + totalExecutionTime);
  </code></pre>