title: Strange try/catch instructions
body: <p>I found these instructions on the web, inside a code of a game. However, I don't understand how it works.</p>
  
  <pre><code>start = System.nanoTime();
  elapsed = System.nanoTime() - start;
          wait = (100/60) - (elapsed / 1000000);
  
          if(wait &lt; 0)
          {
              wait = 4;
          }
  
          try
          {
              Thread.sleep(wait);
          } 
  
          catch (InterruptedException e)
          {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I know that <code>Thread.sleep(wait)</code> makes the thread waiting the amount <code>wait</code> in ms before starting. But in this case, why bother with all these instructions? I tried putting <code>Thread.sleep(0)</code>, and the speed of the game was like 20times faster (all objects moving way too fast).</p>
  
  <p>How does these instructions work?</p>
  
  <p>Thanks in advance.</p>