How much CPU time do B+ proggies use?

Archives Forums/BlitzPlus Programming/How much CPU time do B+ proggies use?

Gabriel(Posted 2003) [#1]
I had a look around in this forum, but I couldn't find anything, and the search function never works.

If I had two B+ executables running at the same time, how much CPU time would they be using? I'm talking applications here, not games, Client/Server stuff. The client wouldn't be actively doing much unless you were using it, and the server would just be sending and receiving packets.

Does the event-driven architecture of B+ make a massive difference from a B2d or it it small/moderate?

soja(Posted 2003) [#2]
Didn't B2D use a lot of the CPU time? I don't remember.

If so, the event-driven model of B+ makes a very big difference. Of course the actual number depends on your CPU and what your program is doing at the moment. But it sounds like it wouldn't be unreasonable for the programs you describe to take only a couple of percent or so.

Gabriel(Posted 2003) [#3]
Perfect. Thanks, Soja.

EDIT : Oh, and yes, B2d exes were like B3d, they'd use 100% CPU time unless you added a delay, in which case you could get things down to 50% or so. But still too much for a multi-tasking application.

EOF(Posted 2003) [#4]
Using WaitEvent() etc.. in B+ I find CPU time at 0% usage when viewed from Task Manager.

Even this example takes up next to nothing:
format_code('; canvas window

Const w=640 , h=480

; setup the window and canvas
win=CreateWindow("Canvas Window",160,120,w,h,Desktop(),3)
SetGadgetLayout can,1,1,1,1
SetBuffer CanvasBuffer(can)

Select WaitEvent(1)
Case $803 : Exit
Case $103 : If EventData()=27 Exit
Oval Rand(w),Rand(h),50,50
FlipCanvas can
End Select