title: c++ sleep taking too much CPU usage
body: <p>I am noob in c++; I have a problem. I am using:</p>
  
  <pre><code>while(true) { 
        doSomething(); 
        Sleep(time);
  } 
  </code></pre>
  
  <p>...in a thread and my program is taking high CPU because of the sleep itself (it checked and it must be the problem). Is there any way to use something else?</p>