> The delay should be raised to at least 20-100 in my opinion,
> this makes the program lighter on the CPU
Nah, 1 is fine. Remember, 1 isn't always going to be exactly 1 ms, it's going
to be whatever the CPU needs at that time. I've done tests using 1, 50 and
100 ms and there was no difference in CPU load at all, and the 50 and 100
settings just made my app less responsive due to the extra forced sleeping.
Turn LCD off until a key is pressed
@PBPB wrote:> The delay should be raised to at least 20-100 in my opinion,
> this makes the program lighter on the CPU
Nah, 1 is fine. Remember, 1 isn't always going to be exactly 1 ms, it's going
to be whatever the CPU needs at that time. I've done tests using 1, 50 and
100 ms and there was no difference in CPU load at all, and the 50 and 100
settings just made my app less responsive due to the extra forced sleeping.
Well i tend to believe you'r right here again when i think about it, because at least some of the times were i was forced to use heigher delay was because i wanted to make sure that something else was finish with watever it was doing.
So you might be right again, delay(1) maybe enough.

Regards Henrik
> some of the times were i was forced to use heigher delay was because
> i wanted to make sure that something else was finish
Yes, if you're waiting for something then of course a longer Delay is needed;
but for a tight loop like this, then 1 ms is way more than enough. Besides, if
you're waiting for something then you should still do a 1 ms delay and just
constantly check for the condition of the other thing in that 1 ms loop.
> i wanted to make sure that something else was finish
Yes, if you're waiting for something then of course a longer Delay is needed;
but for a tight loop like this, then 1 ms is way more than enough. Besides, if
you're waiting for something then you should still do a 1 ms delay and just
constantly check for the condition of the other thing in that 1 ms loop.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.