Run a Java for a particular amout of time
<pre><code>for(int i = 1; i &lt; 10000; i++) {
Command nextCommand = getNextCommandToExecute();
}
</code></pre>

<p>I want to run the above program for 60 minutes. So instead of for loop I need to do something like-</p>

<pre><code>long startTime = System.nanoTime();

    do{
    Command nextCommand = getNextCommandToExecute();
    } while (durationOfTime is 60 minutes);
</code></pre>

<p>But I am not sure, how should I make this program to run for 60 miniutes.</p>
