Jump to content
  • Advertisement

Archived

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

vanillacoke

Timers

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

Advertisement
You can use the function:
unsigned long timeGetTime()
It gives time in milliseconds
It''s contained in winmm.lib

--------------------------------------
I am the master of stories.....
If only I could just write them down...

Share this post


Link to post
Share on other sites
I also use timeGetTime. It is supposedly faster and more accurate than GetTickCount. If you are profiling or something else that needs much smaller time intervals (I am avoiding both the words precision and accurate) there are QueryPerformanceCounter and QueryPerformanceFrequency which are WIN32 API functions (ugh...). They are used together and deliver in the millionth of a second range. Check out the MSDN (ugh...) or the OpenGL SuperBible (chapt 19) if you have it. Lastly, there is the Intel Pentium RDTSC (Read Time Stamp Counter) assembly instruction. It can beat out readings in the 5 nano second range, so I''ve heard. I''ve seen a class wrapper using it. Might be good for something, but it''s obviously not portable. If you ask me, I will post some code for the wrapper class, or somebody else can do it before me if they know how. I may not reply until after the 4th, though (Yippeeee! Fireworks! I bought $90 worth. BOOM!)

Share this post


Link to post
Share on other sites
timeGetTime(). It returns what, the real-world time in milliseconds? Or do you get to reset the clock whenever you choose? I have VC++ 6.0, I assume that means I have winmm.lib?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yeah the search engine is sometimes a little bit buggy .... =)

Share this post


Link to post
Share on other sites
Click search, and wait. Then wait again. It takes time, but it usually ends up giving the results.

It took me longer to find a good thread than it would have taken to write a good answer. But I couldn''t resist doing it again

Cédric

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!