title: Understanding QEMU clocks
body: <p>I'm trying to understand QEMU clocks. There are several reference clocks available. The most important are:</p>
  
  <ul>
  <li>QEMU_CLOCK_REALTIME that is actually a wrapper for a host OS-specific function like QueryPerformanceCounter() or clock_gettime() followed by a conversion to ns units</li>
  <li>QEMU_CLOCK_VIRTUAL runs only during the emulation. In icount mode, virtual clock value is calculated based on number of executed instructions.</li>
  </ul>
  
  <p>It looks like QEMU_CLOCK_VIRTUAL is used by default.</p>
  
  <p>I therefore wonder whether the QEMU_CLOCK_VIRTUAL is synchronized with the realtime clock? In other words, how virtual nanoseconds obtained from instruction counter are related to real nanoseconds so the user can perceive speed wise the emulated HW as the original one?</p>
  
  <p>Can someone give me a hint?
  Thank you in advance!</p>