AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AHK 1.0.47.06 - Bug in Process, Waitclose ?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
nick



Joined: 24 Aug 2005
Posts: 345
Location: Berlin / Germany

PostPosted: Thu Mar 27, 2008 5:50 pm    Post subject: AHK 1.0.47.06 - Bug in Process, Waitclose ? Reply with quote

Hello,

this simple script
Code:
#NoEnv
Loop,
{
   Process, Wait, AutoHotkey.exe
   Process, WaitClose, AutoHotkey.exe
}
ExitApp
produces a CPU load about 30 % on my office system.

Has anyone any idea why? Maybe a bug?
_________________
nick

denick @ http://de.autohotkey.com/forum/
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 458

PostPosted: Thu Mar 27, 2008 5:51 pm    Post subject: Re: AHK 1.0.47.06 - Bug in Process, Waitclose ? Reply with quote

nick wrote:
Has anyone any idea why? Maybe a bug?
You haven't put any sleeps in your loop so it runs at extremely high frequency. This is not a bug, just bad practice.
Back to top
View user's profile Send private message
nick



Joined: 24 Aug 2005
Posts: 345
Location: Berlin / Germany

PostPosted: Thu Mar 27, 2008 5:58 pm    Post subject: Reply with quote

Oberon wrote:
You haven't put any sleeps in your loop so it runs at extremely high frequency. This is not a bug, just bad practice.


AHK Helpfile wrote:
Waits up to Param3 seconds (can contain a decimal point) for a matching process to exist. If Param3 is omitted, the command will wait indefinitely.

For Wait and WaitClose: Processes are checked every 100 milliseconds; the moment the condition is satisfied, the command stops waiting. In other words, rather than waiting for the timeout to expire, it immediately sets ErrorLevel as described above, then continues execution of the script. Also, while the command is in a waiting state, new threads can be launched via hotkey, custom menu item, or timer.

_________________
nick

denick @ http://de.autohotkey.com/forum/
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 458

PostPosted: Thu Mar 27, 2008 6:17 pm    Post subject: Reply with quote

It works for me at 0% load (tested with notepad.exe). Have you tried using Process, Priority, , L and SetBatchLines in your script?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group