QueryPerformanceCounter

How to use function QueryPerformanceCounter?
Without a more specific question, my answer is going to be:

Google it. :)
I have searched google for it,
but i want more information about it
Two more options because you don't let us know what you already know, making it impossible for us to explain any further as we don't know how far you have been already: Google some more, or Bing it.
Don't be mean webJose, Bing never brings back anything useful. ;-)
Hmm, (from my memory) you declare a variable of LARGE_INTEGER type, you call QueryPerformanceCounter() with the address of the variable in arguments, and then you get a time in nanoseconds in the .QuadPart member of the variable.

For include files, windows.h was enough if i remember correctly.

According to my knowledge QueryPerformanceCounter
gives time in milliseconds or microseconds

Can anybody tell me about that?
These articles don't tell about whether it gives time in millisecond
or microsecond
@Fakherthe1 - You need to practice your Googling! When I Googled for "How to use function QueryPerformanceCounter?", the second hit was:

How to use the QueryPerformanceCounter function to time code in Visual C++
http://support.microsoft.com/kb/815668

(And it was first hit when I Binged)

And the articles that Athar's post mentions do tell you what the time is in: QueryPerformanceFrequency is the counter frquency ("in counts per second"), which you use to convert the counter value you get from QueryPerformanceCounter to seconds (or whatever).

Andy

PS This thread might be a bit more helpful? (5th Google hit)

How to use QueryPerformanceCounter?
http://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter
Last edited on
Thanx
Topic archived. No new replies allowed.