Original Post
🔒 Locked
Timing
Advertisement
As mentioned in the DelphiGames mailing list, QueryPerformanceCounter has issues with certain types of hardware where the value returned is not accurate. In my case, it jumped every five seconds or so, causing time-dependent animation to stutter.
GetTickCount has remarkably low resolution (55ms on Windows 95), so it cannot be used to get accurate framerates, but it does work reliably.
Another option is timeGetTime in the multimedia libraries. I have not tried this one myself, but MSDN states that it has 1ms resolution on Windows 95 and ~5ms on Windows NT, depending on hardware.
GetTickCount has remarkably low resolution (55ms on Windows 95), so it cannot be used to get accurate framerates, but it does work reliably.
Another option is timeGetTime in the multimedia libraries. I have not tried this one myself, but MSDN states that it has 1ms resolution on Windows 95 and ~5ms on Windows NT, depending on hardware.
InDirectX, my problem is that I use QueryPerformanceCounter in order to get a fixed framerate in a game, but the timing is no 100% accurate and FPS drops and raises slightly.
Sly, then, what do you suggest to use?? What do you use for timing??
In windows XP, TimeGettime offers a poor resolution (more or less like GettickCount).
Thank you
Sly, then, what do you suggest to use?? What do you use for timing??
In windows XP, TimeGettime offers a poor resolution (more or less like GettickCount).
Thank you
quote:
Original post by patroclus
InDirectX, my problem is that I use QueryPerformanceCounter in order to get a fixed framerate in a game, but the timing is no 100% accurate and FPS drops and raises slightly.
That's a feature.
quote:
Sly, then, what do you suggest to use??
You can either fix the feature or use timeGetTime.
quote:
What do you use for timing??
I fix the feature.
quote:
In windows XP, TimeGettime offers a poor resolution (more or less like GettickCount).
Use timeBeginPeriod and timeEndPeriod as described in the docs for timeGetTime to get 1 ms resolution from it [timeGetTime].
[edited by - IndirectX on June 19, 2002 6:36:47 PM]
Yes, TimeGetTime works reliably using TimeBeginPeriod and setting it to 1ms resolution.
Up to date, it''s the best solution I''ve ever tried to time low FPS such as 50 or 60 FPS.
In my game, the FPS raises and drops slightly using timeGetTime, but makes no problem.
IndirectX, do you think I should try to fix QueryPerformanceCounter instead of using this?? Once I fix it, will the FPS still raise and drop slightly??
the problem with this solution, is that I don''t understand very well how it works after reading the articles. Maybe you could help me a bit.. I''ll apreciate it.
Thank you very much for your help.
Up to date, it''s the best solution I''ve ever tried to time low FPS such as 50 or 60 FPS.
In my game, the FPS raises and drops slightly using timeGetTime, but makes no problem.
IndirectX, do you think I should try to fix QueryPerformanceCounter instead of using this?? Once I fix it, will the FPS still raise and drop slightly??
the problem with this solution, is that I don''t understand very well how it works after reading the articles. Maybe you could help me a bit.. I''ll apreciate it.
Thank you very much for your help.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement