Re: timeout of 0 seconds
Re: timeout of 0 seconds
- Subject: Re: timeout of 0 seconds
- From: Emmanuel <email@hidden>
- Date: Sun, 27 Jun 2004 21:41:57 +0200
At 12:13 PM -0700 27/06/04, Andrew Oliver wrote:
>
Are you sure your test is valid, Emmanuel?
Pretty sure, yes ...
>
Relying on something as variable as a ping timer makes the test invalid -
>
there's no way to know whether the longer time was due to the 'with timeout'
>
statement or just a hiccup on the network.
I spent quite a moment checking before posting. Actually, within the scope of my tests, the ping time was not so variable - 39 ms +/- 3 for Google, 169 ms +/- 10 for Apple, for instance.
>
set t1 to GetMilliSec
>
do shell script "sleep 1"
>
set t2 to GetMilliSec
>
with timeout of 0 seconds
>
do shell script "sleep 1"
>
set t3 to GetMilliSec
>
end timeout
Thanks for helping with this test.
Maybe the weird behavior has something to see with Finder? Look:
chrono
with timeout of 0 seconds
tell application "Finder" to do shell script "sleep 1"
end timeout
chrono
-- 1.183
-- 1.288
-- 1.211
chrono
with timeout of 1 seconds
tell application "Finder" to do shell script "sleep 1"
end timeout
chrono
-- timeout error
chrono
with timeout of 2 seconds
tell application "Finder" to do shell script "sleep 1"
end timeout
chrono
-- 1.023
-- 1.038
-- 1.023
But maybe as I said the only relevant conclusion is that it's a bad idea to write "with timeout of 0 seconds" ...
Emmanuel
_______________________________________________
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.