Skip to main content
gamedev.net
🔒 Locked

Your TimeKeeper

Started by vbisme 5 replies 650+ views
Original Post
vbisme
vbisme
just getting ideas... what do you guys use to keep time and fps in your games? I used the API GetTickCount() by the way if I want to have a 30 fps then is should do 1/30 = .0333333333 seconds so i should set the "delta time" to 33 because the GetTickCount() returns in milliseconds right?
jumble
jumble
I'm a timeGetTime(); man myself, if QueryPerformanceFrequency() isn't available.

As to your query... i think so. Check it, see if it works..

Edited by - jumble on August 20, 2000 5:04:50 PM
jumble-----------
a2k
a2k
my code currently uses timeGetTime() too, but i''ve heard that queryperformance counter is the most accurate. is there a possiblity that it isn''t available?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Andrea
Andrea
I think that timeGetTime() is accurate enough...also an error of 1-2 ms is not significant in animation or FPS counter.

I''m not sure I''ve read on VC++ help that QueryPerformanceFrequency() is used to adjust resolution in GetTickCount() but it''s not a counter itself.
IpSeDiXiT
a2k
a2k
that''s good to know. i''m actually making a racing game that would probably require accuracy of up to 0.1 seconds (tenth of a second), and that''s about as far as i wanna go. so, timeGetTime should be accurate enough for this task?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
jumble
jumble
Yes, according to "Learn DirectX in 24 hours" - the queryperformance counter is not available on older systems / OS''s - not sure how true it is though. There''s a way to check if its available, but im not at my home machine at the mo so i cant look it up for you
jumble-----------
spock
spock
I suspect QueryPerformanceCounter use the RDTSC instruction, which was introduced with the Pentium class of processors. So it might not be available on a 486 machine.

Anyone care to verify?



Edited by - spock on August 28, 2000 11:07:35 AM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.