[bmx] Efficient multitasking by AdamStrange [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:43

Previous topic - Next topic

BlitzBot

Title : Efficient multitasking
Author : AdamStrange
Posted : 1+ years ago

Description : This is the event core I use in my control system.
Note the delay - this gives the system back some time.
I've found that this takes my standard message queue down to 0.1 usage, which may be of help to someone


Code :
Code: blitzmax
Method ProgMain()
	local AppX:int
	local AppY:int
	local AppMouseDown:int
	While Not AppQuit
		WaitEvent()
		Select EventID()
			Case EVENT_APPTERMINATE, EVENT_WINDOWCLOSE 
				AppQuit = True
			Case EVENT_MOUSEMOVE
				AppX = EventX()
				AppY = EventY()
				AppMouseDown = MouseDown(1)
		end select
		delay(2)
	wend
end method


Comments : none...