preformance mesurement
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?
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().
A better option would be QueryPerformanceCounter().
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.
Quote:Original post by discman1028
If you have further troubles, timeGetTime() is nice and easy to use.
timeGetTime and GetTickCount are equivalent...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement