title: How to realise long-term high-resolution timing on windows using C++?
body: <p>I need to get exact timestamps every couple of ms (20, 30, 40ms) over a long period of time (a couple of hours). The function in which the timestamp is taken is invoked as a callback by a 3rd-party library.</p>
  <p>Using <code>GetSystemTime()</code> one can get the correct system timestamp but only with milliseconds accuracy, which is not precise enough for me. Using <code>QueryPerformanceTimer()</code> yields more accurate timestamps but is not synchronous to the system timestamp over a long period of time (see <a href="http://msdn.microsoft.com/en-us/magazine/cc163996.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/magazine/cc163996.aspx</a>).</p>
  <p>The solution provided at the site linked above somehow works only on older computers, it hangs while synchronizing when i try to use it with newer computers.</p>
  <p>It seems to me like boost is also only working on milliseconds accuracy.
  If possible, I'd like to avoid using external libraries, but if there's no other choice I'll go with it.</p>
  <p>Any suggestions?</p>