title: Java : Thread.sleep() in a thread : no wait
body: <p>I have a problem with thread not sleeping.<br />
  I can't put here my whole code. so, to reproduce, here is a basic code waiting 5 seconds.</p>
  
  <pre><code>try {
      int millisec = 5000;
      System.out.println(new Date());
      System.out.println("We wait " + millisec + " milliseconds");
      Thread.sleep(millisec);
      System.out.println(new Date());
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>output :</p>
  
  <p>Thu Aug 22 20:01:42 CEST 2013<br />
  We wait 5000 milliseconds<br />
  Thu Aug 22 20:01:47 CEST 2013<br /></p>
  
  <p>Everything is OK.<br />
  But when I put this code in a thread, no sleep. Example with this code :</p>
  
  <pre><code>try {
      Thread aThread = new Thread(new Runnable() {
          @Override
          public void run() {
              try {
                  int millisec = 5000;
                  System.out.println(new Date());
                  System.out.println("We wait " + millisec + " milliseconds");
                  Thread.sleep(millisec);
                  System.out.println(new Date());
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
      aThread.start();
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>output :</p>
  
  <p>Thu Aug 22 20:07:30 CEST 2013<br />
  We wait 5000 milliseconds<br />
  <br />
  ...and nothing else, the thread is terminated.
  <br />I don't understand why. Please, any ideas ?</p>
  
  <p><strong>EDIT</strong> : I use Eclipse and JUnit to test.</p>