title: Java loop for a certain duration
body: <p>Is there a way I can do a for loop for a certain amount of time easily? (without measuring the time ourselves using System.currentTimeMillis() ?)</p>
  
  <p>I.e. I want to do something like this in Java:</p>
  
  <pre><code>int x = 0;
  for( 2 minutes )  {
     System.out.println(x++);
  }
  </code></pre>
  
  <p>Thanks</p>