Sign in to follow this  
Followers 0
jk0

CPU Utilisation

9 posts in this topic

My CPU utilisation shoots to 40-50% when I launch the GUI I created in Autoit. Has anyone seen this, or does anyone have an idea on what could be causing this?

I stripped down the GUI to just the GUICreate funciton and CPU usage still shoots up. If I run one of the examples however, this does not happen! Could anyone have an explanation for this please? What am I missing?

Share this post


Link to post
Share on other sites



I might not but your gui, it could be a background process. If you could post some code we could look at it to see?


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

This is all I got in there - it still shoots up:

;Create the main interface for the program

$mainGUI=GUICreate("TestGUi", 400, 500, 750, 0)

GUISetState(@sw_Show)

While 1

WEnd

Exit

Share this post


Link to post
Share on other sites

try:

CODE
;Create the main interface for the program

$mainGUI=GUICreate("TestGUi", 400, 500, 750, 0)

GUISetState(@sw_Show)

While 1

sleep (100)

WEnd

Exit


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

Better yet:

CODE
$mainGUI=GUICreate("TestGUi", 400, 500, 750, 0)

GUISetState(@sw_Show)

While 1

select

case $msg = $GUI_EVENT_CLOSE

exit

EndSelect

WEnd

Exit


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

Yup, that was it! Awesome - thanks for your help!

Share this post


Link to post
Share on other sites

Thanks - in my main script - I was executing the while only when the start flag was set - and hence the util was shooting up even when I launched the gui, since the flag wasnt set at launch!

Share this post


Link to post
Share on other sites

LOL


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites

Better yet:

CODE
$mainGUI=GUICreate("TestGUi", 400, 500, 750, 0)

GUISetState(@sw_Show)

While 1

select

case $msg = $GUI_EVENT_CLOSE

exit

EndSelect

WEnd

Exit

Pretty sure you are missing something here in the While-Wend loop...

$msg = GUIGetMsg()


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0