Konstantin Burlachenko
Konstantin Burlachenko

Reputation: 5665

Is QueryPerformanceCounter counter process specific?

https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx

  1. Imagine that I measure some part of code (20ms)
  2. Context switching happend. And my thread was displaced by another thread which was executed (20 ms)
  3. Then I receive quantum of time back from scheduler and perform some cals during 1ms.

If calculate elapsed time then what time will I receive? 41ms or 21 ms?

Upvotes: 0

Views: 231

Answers (1)

David Heffernan
David Heffernan

Reputation: 612934

If calculate elapsed time then what time will I receive? 41ms or 21 ms?

QueryPerformanceCounter reports wall clock time. So the answer will be 41ms.

Upvotes: 3

Related Questions