title: QueryPerformanceCounter throwing incorrect numbers
body: <p>I am using QueryPerformanceCounter to measure the time of some functions/operations. It used to give me correct numbers, for instance, I could test Sleep(1000) and it would return a time very close to 1 second. Now, it returns a time very different. I am not sure what the issue is as the code hasn't changed at all. Here is the code:</p>
  
  <h1>Expected Output:</h1>
  
  <pre><code>duration : 1.000 seconds
  </code></pre>
  
  <h1>Actual Output:</h1>
  
  <pre><code>duration : 187.988 seconds
  </code></pre>
  
  <h1>Code:</h1>
  
  <pre><code>#include &lt;windows.h&gt;
  #pragma comment (lib, "winmm.lib")
  
  
  struct Clock{
  
  Clock(){}
  virtual ~Clock(){}
  void start();
  void stop();
  long double duration();
  
  LARGE_INTEGER _start, _end, _freq;
  
  };
  
  void Clock::start(){
  _start.QuadPart = 0;
  QueryPerformanceCounter(&amp;_freq);
  QueryPerformanceCounter(&amp;_start);
  }
  
  void Clock::stop(){
  QueryPerformanceCounter(&amp;_end);
  }
  
  long double Clock::duration(){
  //microseconds
  LARGE_INTEGER delta;
  delta.QuadPart = (_end.QuadPart - _start.QuadPart) * 1000000;
  long double the_duration = ((long double)delta.QuadPart) / _freq.QuadPart;
  std::cout &lt;&lt; "duration : " &lt;&lt; the_duration &lt;&lt; " seconds" &lt;&lt; std::endl;
  return the_duration;
  }
  
  
  
  
  
  void main(){
  
  Clock clock;
  
  clock.start();
  Sleep(1000);
  clock.stop();
  clock.duration();
  
  std::cin.get();
  }
  </code></pre>