title: Blocking equivalent of Java's Timer
body: <p>Is there a blocking equivalent of the <code>java.util.Timer</code> class? I'm looking for the solution which will block the thread which creates the timer.</p>
  
  <p>The following code is non-blocking and the <code>"After timer"</code> output is printed immediately. </p>
  
  <pre><code>    new Timer().schedule(new TimerTask() {
          @Override
          public void run() {
              System.out.println("Hello");
          }
      }, 1000, 1000);
      System.out.println("After timer");
  </code></pre>
  
  <p>What I want to achieve is <code>"After timer"</code> message printed only if timer has been canceled (and after is has been canceled).</p>