title: Java do something in X minutes
body: <p>I'm looking for a way to do something every X minutes. </p>
  
  <p>For example in a game you will be playing then every 3 minutes activate </p>
  
  <pre><code>foo();
  </code></pre>
  
  <p>but I'm not sure how to do this given that other actions will be going on. Ie, we cannot just wait 3 minutes then do <code>foo()</code> instead the rest of the program must be running and the user can invoke other methods but in the background we have to be counting and getting ready to do <code>foo()</code> when the time is ready.</p>
  
  <p>If anyone can give me a starting point I'd much appreciate it!</p>