title: Java Timer is waiting for Task to finish before next Task starts
body: <p>I have this simple application</p>
  
  <pre><code>package testy;
  
  import java.util.Timer;
  import java.util.TimerTask;
  import static testy.Test.log;
  
  public class Test {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) throws InterruptedException {
      Timer timer = new Timer(true);
      log("tasks start");
      timer.schedule(new Task1(), 1,120000);
      timer.schedule(new Task2(), 3000,120000);
      timer.schedule(new Task3(), 6000,120000);
  
      Thread.sleep(99999999L);
  }
  
  static void  log(String text) {
      System.out.println(text);
  }
  }
  
  class Task1 extends TimerTask {
      @Override
      public void run() {
          log("Task1 start");
          try {
              Thread.sleep(12000L);
          } catch (InterruptedException ex) {
              log("interupted");
          }
          log("Task1 end");
      }
  }
  
  class Task2 extends TimerTask {
      @Override
      public void run() {
          log("Task2 start");
          try {
              Thread.sleep(12000L);
          } catch (InterruptedException ex) {
              log("interupted");
          }
          log("Task2 end");
      }
  }
  
  class Task3 extends TimerTask {
      @Override
      public void run() {
          log("Task3 start");
          try {
              Thread.sleep(12000L);
          } catch (InterruptedException ex) {
              log("interupted");
          }
          log("Task3 end");
      }
  }
  </code></pre>
  
  <p>From this code I expect that Task1 will be fired immediately and Task2 will be fired after 3 seconds (as delay time says). But what happens is Task2 is waiting for Task1 to finish and is fired immediately after that. LOG:</p>
  
  <pre><code>tasks start
  Task1 start
  Task1 end
  Task2 start
  Task2 end
  Task3 start
  Task3 end
  Task1 start
  Task1 end
  Task2 start
  Task2 end
  Task3 start
  Task3 end
  </code></pre>
  
  <p>As I understand Java Timer, Tasks should be fired independantly. Why then behaviour of this app is diffrent? How to achive starting Tasks precisily at the given time, without caring if Timer1 is finished?</p>
  
  <p>Thanks for any help!</p>