Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Rob Loach

timeGetTime() VS GetTickCount()

This topic is 5804 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

I was looking through some APIs and noticed these two. They both do the same thing, but which one is "better" to use? Please give your prefrences and reasons. Regards, - Rob Loach OverTech Technologies ----------- "Life moves pretty fast. If you don''t stop and look around once in awhile, you could miss it." - Ferris Bueller

Share this post

Link to post
Share on other sites
TimeGetTime() is portable on all platforms, standard in C(++?)
whereas GetTickCount() is M$ only. but they do the exact same thing.
Atleast that''s the only difference I know of. Did I miss something?

Share this post

Link to post
Share on other sites
a couple of things.

first, timeGetTime is a win32 function, not a c one.

second, timeGetTime is much more accurate than GetTickCount (1 ms vs 50 ms resolution).

third, GetTickCount takes less time to execute.

fourth, nice use of the $. (stolen from Stoffel)

use GetTickCount if 50 ms resolution is acceptable because it has less overhead, and timeGetTime if you need more precise timing. remember to call timeBeginPeriod and timeEndPeriod to obtain 1 ms resolution on nt.

example: timeGetTime is a better choice if you want to calculate fps for your game, and GetTickCount will be better if you want to drop inactive clients from your game after let's say one minute timeout.

[edited by - niyaw on December 3, 2002 5:13:38 AM]

Share this post

Link to post
Share on other sites

  • 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!