GETTIMER() and SLEEP issues

Previous topic - Next topic

Hemlos

Err,
I found more information on the GETTIMER() issue.

if SLEEP = 0 then my test program runs 4000 fps
if SLEEP = 1 then my test program runs 60fps

Adding 1 millisecond per frame shouldnt cause the frame rate to drop to 60 fps.
The frame rate should be 1000 fps.

Anyone have an idea of whats going on?




Bing ChatGpt is pretty smart :O

Moru

Did you set LIMITFPS?

Normaly you aren't supposed to get more than 500 FPS because that is the cap in GLBasic.
If I do a simple loop only displaying the FPS and put a SLEEP 1 in it, I get 512 FPS, if I remove the SLEEP I get 500.

Hemlos

ok...
The test program normally runs 4000 fps with LIMITFPS 60000

Now, I set it to 500:

LIMITFPS 500.
SLEEP 0 = 500 FPS
SLEEP 1 = 60 fps

It shouldnt drop to 60 fps if SLEEP is set to 1.
It should be hitting the max frame rate of 500.


Bing ChatGpt is pretty smart :O

Hemlos

Gernot, any input here?
Bing ChatGpt is pretty smart :O

MrTAToad

Dont forget that SLEEP returns control to the operating system.

Hemlos

Hmm, so windows is hogging my fps with sleep 1 ?


Bing ChatGpt is pretty smart :O

Moru

What did you set your grafics card to? Limit FPS or free FPS or Application desides?

Hemlos

#7
nvidia gt6800

set FORCE VSYNC = OFF


Remeber when i had an issue with getpixel?
This was the solution.
Bing ChatGpt is pretty smart :O

Moru

Solution for getpixel should be AA = off.

Hemlos

indeed, but i want higher fps regardless.
the ability to of testing programs with extreme frame rates is desirable.

i found a workaround, i dont need sleep anymore,
Bing ChatGpt is pretty smart :O

MrTAToad

QuoteHmm, so windows is hogging my fps with sleep 1 ?
It could be doing anything with it...

Kitty Hello

I have no idea. I really just call the SLEEP command from the operating system.

MrTAToad

Quotei found a workaround, i dont need sleep anymore,
You shouldn't anyway...  Did you use GETTIMER directly after the sleep command as well ?

Hemlos

No, i only use GETTIMER() in my programs one time.....right before the SHOWSCREEN, as it reports the time since the last showscreen.
Bing ChatGpt is pretty smart :O

MrTAToad

I expect the time difference would be large between the SLEEP command causing the FPS to be less than what you would normally get.  I think the FPS value with SLEEP would be correct though, especially as it would slow everything down... =D