Skip to main content
GameDev.net gamedev.net
🔒 Locked

30ms for Clear()?!

Started by Zaei Dec 1, 2001 at 2:35 PM 6 replies 700+ views
Original Post
Zaei
Zaei
I have a feeling that something is seriously wrong. If i run a render loop containing:
  
start = GetTickCount();
Clear(0) // clears the screen to black


Flip() // flips to the screen...

end = GetTickCount();
  
end - start == 0..30ms, averaging around 20..24ms. I have the Retail runtimes selected in the Control panel thingie as well. Im running Win2k, with an ATI RagePro (i know, its terrible, but not this bad), ~550 p3, with the HAL device. Any help would be much appreciated. Z.
__"Evil is Loud"
Zaei
Zaei
Its accurate enough to tell me that something is wrong. Clear is usually ~0ms, and suddenly its ~30.

Z.
__"Evil is Loud"
Kippesoep
Kippesoep
Yeah, the accuracy is that bad. And the actual call to GetTickCount is also very slow. I am working on a game full of graphics code, AI code and game logic and the very few calls to the Windows timer accounted for 2.7% of total execution time. If you want to time your stuff, use the performance counter (see QueryPerformanceCounter in msdn).

Also, it is very likely that the V-sync is what is actually killing your framerate.

And finally, "I wish the Rage Pro would just go away and die". That''s what an ATI employee told me at ECTS last August...
Kippesoep
Zaei
Zaei
I wish my Rage Pro would die too. But it is definatly not my counter, beacuse it is accurate within 10ms (i get 0, 10, 20 and 30 as return values, mostly 30, when it should be mostly 0, with a few 10s thrown in).

The refresh rate on my moniter is set to 100 Hz. Would that account for 30ms?

Z.
__"Evil is Loud"
Zaei
Zaei
Heh, removed the little _VSYNC from my swap effect, and that kinda halved that 30ms. Thanks guys =).

Z.
__"Evil is Loud"
Moe
Moe
Just out of curiosity, is timeGetTime() just as horrible for accuracy?

Topic Locked

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

Sign in to reply to this topic.