Timers

Started by
9 comments, last by vanillacoke 20 years, 9 months ago
I am in need of a timer library or program... what do people here use, and where do I go about finding such things?
You know what I never noticed before?
Advertisement
I wrote my own little timer class. You can find it on my site.

My Homepage
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
That looks like something I might be able to use. Could you tell me how it works?
You know what I never noticed before?
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...
I am the master of ideas.....If only I could write them down...
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!)
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?
You know what I never noticed before?
Behold, the power of Gamedev''s search engine

Besides, you should have asked this in the General programming forum.

Cédric

...how... ...how do you get threads from search engine? ...strange...
You know what I never noticed before?
Yeah the search engine is sometimes a little bit buggy .... =)
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

This topic is closed to new replies.

Advertisement