QueryPerformanceCounter

May 3, 2012 at 1:16pm
How to use function QueryPerformanceCounter?
May 3, 2012 at 2:02pm
Without a more specific question, my answer is going to be:

Google it. :)
May 4, 2012 at 6:47am
I have searched google for it,
but i want more information about it
May 4, 2012 at 7:04am
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.
May 4, 2012 at 7:22am
Don't be mean webJose, Bing never brings back anything useful. ;-)
May 4, 2012 at 11:10am
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.

May 4, 2012 at 11:28am
According to my knowledge QueryPerformanceCounter
gives time in milliseconds or microseconds

Can anybody tell me about that?
May 4, 2012 at 11:59am
May 5, 2012 at 1:32pm
These articles don't tell about whether it gives time in millisecond
or microsecond
May 5, 2012 at 2:37pm
@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 May 5, 2012 at 2:43pm
May 6, 2012 at 3:14pm
Thanx
Topic archived. No new replies allowed.