Re: "idle" has different effect in X vs 9?
Re: "idle" has different effect in X vs 9?
- Subject: Re: "idle" has different effect in X vs 9?
- From: Andrew Oliver <email@hidden>
- Date: Fri, 09 May 2003 02:39:38 -0700
>
> I notice that Smile has the same usage profile as Script Editor; I
>
> don't have a copy of Script Debugger handy. I'm curious now; I'm not
>
> sure that it's possible to write a script runner that behaves really
>
> well for both normal script running and "delay" given the current
>
> architecture. It still doesn't change the answer for scripters, though.
Script Debugger does the same thing - pegs CPU at 100% while the delay
statement is running. Saving the script as an app and running the app uses
virtually no CPU time.
Given that all the common script editors exhibit the same issue, doesn't
that point at a system-level problem (presumably in 'delay') rather than a
script editor issue?
Andrew
:)
On 5/9/03 2:27 AM, "Christopher Nebel" <email@hidden> wrote:
>
On Friday, May 9, 2003, at 12:07 AM, John Delacour wrote:
>
>
> At 5:11 pm -0700 8/5/03, Christopher Nebel wrote:
>
>
>
>> It turns out that Script Editor 2 has the same problem as Script
>
>> Editor 1 -- I'd claimed otherwise last week, so I've filed a bug.
>
>
>
> The way I used to do it before we had 'delay' was
>
>
>
> set t to (current date)
>
> repeat until (current date) is t + 2
>
> end repeat
>
> beep
>
>
>
> Would that be more or less greedy?
>
>
More, though under the current circumstances, it doesn't make much
>
difference. The loop will busy-wait, consuming CPU, and call the
>
active proc about every 10 ticks (1/6 second).
>
>
Using "delay" has the advantage of being nicer to background processes
>
on 9 (nicer than your loop, anyway) and will behave better in
>
better-behaved script runners, whereas your loop will always suck CPU.
>
>
I notice that Smile has the same usage profile as Script Editor; I
>
don't have a copy of Script Debugger handy. I'm curious now; I'm not
>
sure that it's possible to write a script runner that behaves really
>
well for both normal script running and "delay" given the current
>
architecture. It still doesn't change the answer for scripters, though.
>
>
>
--Chris Nebel
>
Apple Development Tools
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.