preformance mesurement

Started by
4 comments, last by GameDev.net 18 years ago
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?
Advertisement
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().
ok thanks that worked,
by the way what mesurement is it giving in
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.
If you have further troubles, timeGetTime() is nice and easy to use.
--== discman1028 ==--
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