 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
nick
Joined: 24 Aug 2005 Posts: 345 Location: Berlin / Germany
|
Posted: Thu Mar 27, 2008 5:50 pm Post subject: AHK 1.0.47.06 - Bug in Process, Waitclose ? |
|
|
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 |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Thu Mar 27, 2008 5:51 pm Post subject: Re: AHK 1.0.47.06 - Bug in Process, Waitclose ? |
|
|
| 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 |
|
 |
nick
Joined: 24 Aug 2005 Posts: 345 Location: Berlin / Germany
|
Posted: Thu Mar 27, 2008 5:58 pm Post subject: |
|
|
| 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 |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Thu Mar 27, 2008 6:17 pm Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|