Re: Is it possible to set up an 'instant' idle handler
Re: Is it possible to set up an 'instant' idle handler
- Subject: Re: Is it possible to set up an 'instant' idle handler
- From: John W Baxter <email@hidden>
- Date: Mon, 7 Oct 2002 15:32:54 -0700
At 14:29 -0400 10/7/2002, Marc K. Myers wrote:
>
Someone (I think it was Paul Berkowitz) pointed out if you don't put in
>
a return statement an idle handler will repeat "instantly". I have
>
found through experimentation that this is not true. I constructed
>
this script for testing:
>
... script omitted
>
>
The result was 1016 seconds, slightly more than a second per iteration.
>
I ran this on a 466MHz G4 machine under OS 10.2.1.
Marc is correct...not having a return in an idle handler (or in the path
the idle handler exited through) leaves unchanged the current idle
interval. The initial interval is one second, so Marc's timed result makes
good sense.
However, it's not quite that simply, since absent a return the result from
the last executed command is returned. If that's numeric, it affects the
idle time. It's probably best to be explicit.
At 14:29 -0400 10/7/2002, Marc K. Myers wrote:
>
Yes, if you put your check in a tight loop it will waste system
>
resources but there is no provision for idle handlers to return on less
>
than a one second interval. If you really need to check at 0.1 second
>
intervals you may have to develop a conventional application.
Yes...the on idle construct has a granularity of one second. That's a
longer time on moderm machines than it was on 1991 machines, in terms of
work accomplished.
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
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.