CPU Usage

Hello
My CPU usage runs at around 50% whenever I have the editor open and does the same when I create an application with a true controls interface or CTX interface. I have noticed on the applications I create that if I put a short pause into the main loop the CPU is normal. Is this the recommended way to avoid high CPU usage with TB or is it a bug in the true controls library. Applications created with TB 5.5 did the same thing. I am using it on a Vista system with a dual core CPU.

Thanks and reagrds
Dave Rush

Comments

CPU usage

Hi Dave,

The culprit is the SYS_EVENT routine which is common to CTX, TrueCtrl and to the editor. Your tip about putting a small pause in the event loop is a good one - depending on how big the pause is. Fortunately, SYS_EVENT accumulates events in a queue so even if an event occurs during a pause it should still pick it up - at least I think so.

At present I don't think I will modify the event routine to include a pause until I have investigated it more fully. There are times when you have multiple windows showing, when the event routine cannot keep up with the refresh rate as each window is made active. Putting a small pause in may reduce or eliminate the flicker caused when this happens.

Regards
Big John

Hi John I put in a 1

Hi John
I put in a 1 millisecond pause and that quietens things down, I have no idea what effect that will have on the events loop. I don't notice it on the simple applications I write.

Regards
Dave

CPU usage

Hi Dave,

Thanks. I will give it a try.

Regards
Big John