Re: Compiled script and high CPU %
Re: Compiled script and high CPU %
- Subject: Re: Compiled script and high CPU %
- From: Michael Eldridge <email@hidden>
- Date: Tue, 10 May 2005 11:36:56 -0700
Here's an event loop handler I wrote which is called when the user clicks a button.
on eventLoop(message)
repeat while recordDuration > 0
if message is equal to "stop" then
set recordDuration to 0
else
set recordDuration to (recordDuration - EVENT_DELAY)
delay EVENT_DELAY
checkBroadcast()
end if
end repeat
end eventLoop
I have tried not calling the event loop I wrote and using a straight delay statement of length recordDuration but that didn't fix the probelm. What's a good way to handle idle time in a script?
In regards to you other comment, the zero CPU % when the script is in the background only occurs if Broadcaster is not recording. If Broadcaster is recording it doesn't matter is the script is in the foreground or background it still uses about 40% CPU.
Thanks for the quick reply.
On Tuesday, May 10, 2005, at 11:22AM, Andrew Oliver <email@hidden> wrote:
>First thoughts relate to how you're script is written to handle idle time.
>Are you using repeat loops and 'delay' or are you using an idle handler?
>
>On from there, since:
>>If I switch to another app the script CPU % drops to zero.
>
>Why not just have your script activate some other application, thereby
>forcing itself to the background?
>
>Andrew
>:)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden