title: Win32 game loop that doesn't spike the CPU
body: <p>There are plenty of examples in Windows of applications triggering code at fairly high and stable framerates without spiking the CPU.</p>
  
  <p>WPF/Silverlight/WinRT applications can do this, for example. So can browsers and media players. How exactly do they do this, and what API calls would I make to achieve the same effect from a Win32 application?</p>
  
  <p>Clock polling doesn't work, of course, because that spikes the CPU. Neither does <code>Sleep()</code>, because you only get around 50ms granularity at best.</p>