title: Why does an empty loop use so much processor time?
body: <p>If I have an empty while loop in my code such as:</p>
  
  <pre><code>while(true);
  </code></pre>
  
  <p>It will drive the processor usage up to about 25%.  However if I do the following:</p>
  
  <pre><code>while(true)
      Sleep(1);
  </code></pre>
  
  <p>It will only use about 1%.</p>
  
  <p>So why is that?</p>
  
  <p>Update: Thanks for all the great replies, but I guess I really should have asked this question, <a href="https://stackoverflow.com/questions/175882/whats-the-algorithm-behind-sleep">What&#39;s the algorithm behind sleep()?</a> which is more of want I wanted to know.</p>