← Back to team overview

sikuli-driver team mailing list archive

[Question #697099]: High Cpu load by starting and stopping observer in while()

 

New question #697099 on SikuliX:
https://answers.launchpad.net/sikuli/+question/697099

Greetings, I'm Jerry. I'm using sikulix ide 2.0.5 to create a bot for a browser game for myself, and currently I have a problem with cpu load. Here's some details.

I'm using 10 onAppear for 1 observer on 1 region. After defining the onAppear first at start, I use while(1) then start and stopping the observer in it. 
At first run, the cpu load only around 10-11%, but after about 10 repetitions, the cpu got high load around 75-80%. After I check, for 1 repetition, the cpu load increases around 5-10%, and keep going up.


Here's a snippet on the script :

DefineOberver()   #onAppear declaration goes here

While(1)
   MyRegion.observeInBackground()
   Raid()
   MyRegion.stopObserver()


Any idea why this can happen, and how to solve this? I can put more of my codes here if it helps.


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.