GLBasic forum

Main forum => Bug Reports => Topic started by: Hemlos on 2009-Nov-24

Title: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
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?




Title: Re: GETTIMER() and SLEEP issues
Post by: Moru on 2009-Nov-24
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.
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
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.


Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
Gernot, any input here?
Title: Re: GETTIMER() and SLEEP issues
Post by: MrTAToad on 2009-Nov-24
Dont forget that SLEEP returns control to the operating system.
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
Hmm, so windows is hogging my fps with sleep 1 ?


Title: Re: GETTIMER() and SLEEP issues
Post by: Moru on 2009-Nov-24
What did you set your grafics card to? Limit FPS or free FPS or Application desides?
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
nvidia gt6800

set FORCE VSYNC = OFF


Remeber when i had an issue with getpixel?
This was the solution.
Title: Re: GETTIMER() and SLEEP issues
Post by: Moru on 2009-Nov-24
Solution for getpixel should be AA = off.
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-24
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,
Title: Re: GETTIMER() and SLEEP issues
Post by: MrTAToad on 2009-Nov-25
QuoteHmm, so windows is hogging my fps with sleep 1 ?
It could be doing anything with it...
Title: Re: GETTIMER() and SLEEP issues
Post by: Kitty Hello on 2009-Nov-25
I have no idea. I really just call the SLEEP command from the operating system.
Title: Re: GETTIMER() and SLEEP issues
Post by: MrTAToad on 2009-Nov-25
Quotei found a workaround, i dont need sleep anymore,
You shouldn't anyway...  Did you use GETTIMER directly after the sleep command as well ?
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-25
No, i only use GETTIMER() in my programs one time.....right before the SHOWSCREEN, as it reports the time since the last showscreen.
Title: Re: GETTIMER() and SLEEP issues
Post by: MrTAToad on 2009-Nov-25
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
Title: Re: GETTIMER() and SLEEP issues
Post by: Hemlos on 2009-Nov-25
Thanks for the replies and helping me understand the SLeep function.

GLBasic Team Rocks On!  :good: