Optimizing CPU usage

BlitzPlus Forums/BlitzPlus Programming/Optimizing CPU usage

I have been messing with CPU usage and CShop, and thought I would mention that a WaitEvent() uses MUCH less CPU power than a similar loop of Blitz code, like a While MouseXSpeed()=0 kind of thing.

Thought it would be useful to know.

That's the basic idea -- with WaitEvent () your program waits quietly for a window event to occur before it does anything, unlike 'regular' Blitz code where it's always trying to do something (unless you stick a Delay () in)...

or use WaitTimer...

use waitevent(1)