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: Christopher Nebel <email@hidden>
- Date: Fri, 9 May 2003 02:27:52 -0700
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.