Optimizing CPU usage

BlitzPlus Forums/BlitzPlus Programming/Optimizing CPU usage

JoshK(Posted 2003) [#1]
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.


BlitzSupport(Posted 2003) [#2]
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)...


skidracer(Posted 2003) [#3]
or use WaitTimer...


Panno(Posted 2003) [#4]
use waitevent(1)