Sign in to follow this  
Kaze

preformance mesurement

Recommended Posts

does anyone know if there is some generally accepted method to time performance, i have tried both gettickcount and clock but i always get 0 or 16, why is that, is it the size of a time quantum or something?

Share this post


Link to post
Share on other sites
clock() just calls GetTickCount() internally on Windows, which is why you get the same value from each. GetTickCount() has a certain granuality (I don't recall what exactly, but 16ms sounds about right), as do most of the timer functions.

A better option would be QueryPerformanceCounter().

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
clock() just calls GetTickCount() internally on Windows, which is why you get the same value from each. GetTickCount() has a certain granuality (I don't recall what exactly, but 16ms sounds about right), as do most of the timer functions.


1/64th of a second (thus it reports 16 ms most of the time and 15 ms other times).

OP: As stated in the documentation that was so kindly provided, the resolution is in "counts", an abstract unit of high precision (likely related to clock cycles). The companion QueryPerformanceFrequency() function will tell you how many "counts" there are in a second, so you can do your math from there.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by discman1028
If you have further troubles, timeGetTime() is nice and easy to use.

timeGetTime and GetTickCount are equivalent...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this