title: Can I use wait instead of sleep?
body: <p>I came across a question in which the poster tried to have a thread wait for a second. They were using <code>wait</code>, but outside a <code>synchronized</code> block, and therefore it crashed.</p>
  
  <p>Given a running thread, to pause the execution for a given time, one would do:</p>
  
  <pre><code>Thread.sleep(1000);
  </code></pre>
  
  <p>This should work as well, and have very similar result:</p>
  
  <pre><code>synchronized(this) {
      this.wait(1000);
  }
  </code></pre>
  
  <p>Using the <code>wait</code> timeout, the thread will unpause 1 second later.</p>
  
  <p>The question is this: if I don't have any monitoring and notifying issue, is there an actual reason to use one over the other?</p>