Ooops
October 28, 2020, 05:57:57 AM

Author Topic: [bmx] Efficient multitasking by AdamStrange [ 1+ years ago ]  (Read 1178 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
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
  1. Method ProgMain()
  2.         local AppX:int
  3.         local AppY:int
  4.         local AppMouseDown:int
  5.         While Not AppQuit
  6.                 WaitEvent()
  7.                 Select EventID()
  8.                         Case EVENT_APPTERMINATE, EVENT_WINDOWCLOSE
  9.                                 AppQuit = True
  10.                         Case EVENT_MOUSEMOVE
  11.                                 AppX = EventX()
  12.                                 AppY = EventY()
  13.                                 AppMouseDown = MouseDown(1)
  14.                 end select
  15.                 delay(2)
  16.         wend
  17. end method


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal