title: How to use thread.sleep() properly in Java?
body: <p>I see a lot of code snippets below in our code base:</p>
  
  <pre><code>        try {
              Thread.sleep((int)Millis);
          } catch (InterruptedException e) {
          }
  </code></pre>
  
  <p>Apparently, an empty catch clause is not a good idea. If the thread is interrupted, the sleep period will not be finished completely.</p>
  
  <p>I am wondering if there's no logic in my code to interrupt the thread, could JVM interrupt a thread which is sleeping? If so, how to ensure a thread sleep to the end of its specified period?</p>
  
  <p>And what's the best practice to use <code>thread.sleep()</code> method?</p>