Re: timeout of 0 seconds
Re: timeout of 0 seconds
- Subject: Re: timeout of 0 seconds
- From: Andrew Oliver <email@hidden>
- Date: Sun, 27 Jun 2004 12:13:52 -0700
Are you sure your test is valid, Emmanuel?
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.
Indeed, the following code snippet indicates the opposite, where the 'with
timeout 0' statement consistently performing faster than the other
(admittedly, only by a second or two, but not the order of magnitude
difference you're seeing).
(note I'm using the getmillisec OSAX rather than chrono since I don't have
Smile)
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
display dialog "No timeout = " & ((t2 - t1) as string) & return & "Timeout 0
=" & (t3 - t2) as string
Andrew
:)
On 6/27/04 4:15 AM, "Emmanuel" <email@hidden> wrote:
>
On my machine (10.2.8) "with timeout of 0 seconds" makes things slower. I
>
suppose it's a bad idea to use "timeout of 0 seconds".
>
>
-------------------
>
chrono -- this works only in Smile
>
with timeout of 0 seconds
>
tell application "Finder" to do shell script "ping -c 1 '66.102.9.99'"
>
end timeout
>
chrono
>
-- Results: 0.20 to 0.50 second (but no timeout error)
>
-------------------
>
>
-------------------
>
chrono -- this works only in Smile
>
with timeout of 1 seconds
>
tell application "Finder" to do shell script "ping -c 1 '66.102.9.99'"
>
end timeout
>
chrono
>
-- Results: 0.05 to 0.06 second
>
-------------------
>
>
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.
_______________________________________________
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.