Archived

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

vsync disabled owns timeGetTime

This topic is 4946 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 calculate my time delta between frames using timeGetTime. I use it for things like camera movement. Works fine with vsync enabled, but when I disable it my camera screws up because I think the time delta''s are so small they''re getting rounded to 0. Is there a more precise function I could use? Thanks

Share this post


Link to post
Share on other sites
On Windows you can use the performance counter:

__int64 counterfreq;
__int64 t;
QueryPerformanceFrequency((LARGE_INTEGER*)&counterfreq));
QueryPerformanceCounter((LARGE_INTEGER*)&t);



[edited by - frankd on May 30, 2004 7:07:45 PM]

Share this post


Link to post
Share on other sites
... why are you worried about the time that a timer system call takes, when you just finished telling us that your problem is that your FPS is too high for the existing timer?

Share this post


Link to post
Share on other sites
I''m having the same problem,but I''m writing my code cross-platform. Is there a way to find time accurately in C#/.net without importing a function from a Windows ,dll?

Share this post


Link to post
Share on other sites
I believe GetTickCount() is the command in C#/Windows. As for the clock data rounding off, just put in a max frame rate at say 70FPS, that should ensure that your camera movement will work properly.

--------------------------------------------------------------------------------
Good Links: C++ Reference, Java API
SDL Home Page, Lua Scripting Language, Python Scripting Language
Chris Taylor''s Design Document (Downloadabe MS-Word Only), Blitz Basic Homepage

Share this post


Link to post
Share on other sites
QueryPerformanceCounter() takes about 10 clocks, I believe.

timeGetTime() takes 100+, and is very, very inaccurate.

There is no good, portable method for accurate timing that doesn''t have fairly excessive overhead. The best you can do is run the appropriate function for the OS you''re compiling for.

Share this post


Link to post
Share on other sites
Oops, looks like my current System.Environment.TickCount has accuracy over 60FPS, good enough for me. My current ~10 textured quads were just running at over 800 FPS.

Share this post


Link to post
Share on other sites