Skip to main content

History: -QueryPerformanceCounter

Source of version: 1

Copy to clipboard
            {TRANSCLUDE(page="todoBox")}
* add useful forum links (e.g. with code snippets)
{TRANSCLUDE}
{INCLUDE(page="ogrelex ext tpl")/}
---

The __QueryPerformanceCounter__ is the most precise time stamp counter on Windows systems. 

It's useful e.g. for ((-FPS|FPS)) calculations.


!!!Notes:

* The value of __QueryPerformanceFrequency__ never changes, while a system is running.
* Aware: It's possible that __QueryPerformanceFrequency__ returns 0 on some hardware systems.
* Aware: The difference between an older and a newer value of the __QueryPerformanceCounter__ can be negative. (This can happen when the thread moves from one CPU core to an other.)



!!See also:

* [http://msdn.microsoft.com/en-us/library/ee417693%28VS.85%29.aspx|Game Timing and Multicore Processors] - important notes
* [http://msdn.microsoft.com/en-us/library/ms644904(v=VS.85).aspx|QueryPerformanceCounter] - AP description
* [http://msdn.microsoft.com/en-us/library/ms644905%28VS.85%29.aspx|QueryPerformanceFrequency] - API description
* [http://en.wikipedia.org/wiki/Time_Stamp_Counter|Time Stamp Counter] - Wikipedia
* [http://support.microsoft.com/kb/172338|How To Use QueryPerformanceCounter to Time Code] - MSDN page with code snippets
* [http://msdn.microsoft.com/en-us/library/ee417693%28VS.85%29.aspx|High Precision Event Timer] (HPET) - Wikipedia, formerly ''Multimedia Timer''
* [http://support.microsoft.com/kb/274323|Performance counter value may unexpectedly leap forward] - MSDN
* [http://support.microsoft.com/kb/306979|How to use the QueryPerformanceCounter in Visual C#] - MSDN; Code snippet for use ((MOGRE|Mogre))


        

History

Information Version
Fri 13 of Aug, 2010 20:27 GMT-0000 Beauty corrected wrong URL + added 1 new link 4
Fri 13 of Aug, 2010 20:17 GMT-0000 Beauty added quote of a forum post 3
Fri 13 of Aug, 2010 18:57 GMT-0000 Beauty 2
Fri 13 of Aug, 2010 18:52 GMT-0000 Beauty NEW PAGE - information and useful links 1