title: Executing some code after a specific amount of time
body: <p>I need to execute an action after a specific amount of time (for example 30 minutes after the app started up, if the app is still up).</p>
  
  <p>What are my options and will it necessary means there's going to be one thread "lost" waiting for the 30 minutes to pass by?</p>
  
  <p>Ideally, at program startup, I'd like to do something like the following (simplified on purpose) and then don't have to think about it anymore:</p>
  
  <pre><code>   doIfStillUp( 30, new Runnable() {
         ....    
     }); 
  </code></pre>
  
  <p>So how should I go about implementing <em>doIfStillUp(...)</em>?</p>
  
  <p>Should I use a <em>TimerTask</em>?  The <em>Executor</em> framework?  </p>
  
  <p>Most importantly (it's for understanding purpose): does this mean there's going to be one thread lost idling for basically nothing during 30 minutes?  </p>
  
  <p>If there's going to be one thread "doing nothing", is this an issue?  What if there are 10 000 threads (I'm being facetious here) "doing nothing"?</p>
  
  <p>Note that I'm trying to understand the "big picture", not to solve a particular problem.</p>