timeGetTime scale?
hello,
i was just wondering what the timeGetTime() function returns for its time scale. i.e. - how many timeGetTime() units does it take to make a second?
thanks,
-jesse
quote:The timeGetTime function retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started.
Right, so float Time = float(timeGetTime()) * 0.001f is what you''d want for precise time measurements. Or doubles.
~CGameProgrammer( );
~CGameProgrammer( );
Actually you should process time as integer deltas rather than convert it to floating point, to avoid floating point precision errors (it''s also much faster).
In other words, just store all your times as DWORDs.
--
Eric
In other words, just store all your times as DWORDs.
--
Eric
Okay, if it''s in miliseconds, wouldn''t I divide it by 1,000? Like: DWORD time = timeGetTime()/1000... so if it returned 5000 miliseconds, it''d be 5 seconds? Or am I seriously confused?
-Jesse
-Jesse
You are correct.
---
Make it work.
Make it fast.
"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
---
Make it work.
Make it fast.
"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
Yes, you are correct, but if you are planning on dealing with game programming and using timeGetTime() to keep track of the internal fps independent scale, you will not want to deal in seconds (you dont want your frame to change every 5 secs, you want it to change every xxx milliseconds).
Maybe I am just tired and talking crap, but hell
Cray
Maybe I am just tired and talking crap, but hell
Cray
But dividing numbers is very slow, so you might as well convert to floating-point and multiply (by 0.001, which is 1/1000), which together is probably about the same as an integer divide. But that''s just my opinion.
~CGameProgrammer( );
~CGameProgrammer( );
just some suggestions you might find helpful or not :
use the milli-seconds unmulitplied and undivided.
divide before you output anything.
btw: use the timeBeginPeriod() to set higher resolution.
default is 5 or more on NT/2000, but 1 is possible on nearly every system.
if you dont need a high resolution, use GetTickCount().
its much faster.
bye,
-- foobar
Edited by - foobar on January 30, 2002 5:03:33 PM
use the milli-seconds unmulitplied and undivided.
divide before you output anything.
btw: use the timeBeginPeriod() to set higher resolution.
default is 5 or more on NT/2000, but 1 is possible on nearly every system.
if you dont need a high resolution, use GetTickCount().
its much faster.
bye,
-- foobar
Edited by - foobar on January 30, 2002 5:03:33 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement