Jump to content
  • Advertisement
Sign in to follow this  
Kaze

preformance mesurement

This topic is 4493 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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().

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!