Wait 0 doesn't

Jim Hurley jhurley at infostations.com
Tue Apr 29 10:28:01 EDT 2003


>
>Message: 15
>Date: Mon, 28 Apr 2003 19:01:49 -0600
>Subject: Re: Wait 0 doesn't
>From: Dar Scott <dsc at swcp.com>
>To: use-revolution at lists.runrev.com
>Reply-To: use-revolution at lists.runrev.com
>
>
>On Monday, April 28, 2003, at 06:09 PM, Dar Scott wrote:
>
>>  on mouseup
>>    put the long seconds into a
>>    put the long seconds into b
>  >   wait 0 seconds
>>    put the long seconds into c
>>    wait 0 milliseconds
>>    put the long seconds into d
>>    wait 0 ticks
>>    put the long seconds into e
>>    put (c-b) & "  " & (d-c) & "  " & (e-d) into field "report"
>>  end mouseup
>>
>>  I got results like this:
>>  0.000708  0.000084  0.000075
>
>Argh.
>
>I fiddled with this some more.
>
>Minimum delay of about .7 ms seems to apply to the first wait.  The
>best I can tell, so far, it has nothing to do with seconds.
>
>So, everything I suggested about your problem possibly being related to
>using seconds, Jim, is all wrong.
>
>Not only that, it means I'm not able to confirm that waiting 0 takes
>very long.
>
>Dar Scott
>


Dar,

I tried your script and got roughly the  same results. (BTW: this is 
a Mac specific problem. Wait 0 works as expected on the  PC.)

When you say you can't confirm that wait 0 takes very long, did you 
try my version of "wait", that is:

myWait temp
if temp = 1 then exit myWait
wait temp ticks --or milliseconds or whatever, depending
end myWait

I get roughly the  same results with this version of Wait on my Mac 
as I get with the built-in "wait" on PC.

I think it is a problem of consistency. For example when I run:

on mouseUP
   put empty into field 1
   repeat 200
       put the milliseconds into startTime
       wait 0 ticks --Quite variable
      -- myWait 0  -- Quite smooth
       put  the milliseconds - startTime & comma & space after field 1
   end repeat
end mouseUP

on myWait temp
   if temp = 0 then exit myWait
   wait temp ticks
end myWait


I get the following list:

1, 1, 1, 7, 2, 1, 1, 2, 1, 1, 1, 3, 5, 8, 5, 9, 1, 0, 0, 1, 0, 0, 1, 
7, 1, 1, 1, 1, 1, 1, 0, 4, 1, 2, 1, 1, 1, 0, 0, 4, 8, 1, 1, 1, 0, 1, 
1, 2, 8, 0, 1, 1, 1, 1, 1, 1, 9, 1, 0, 1, 2, 1, 1, 3, 4, 8, 12, 4, 5, 
3, 4, 4, 4, 9, 3, 3, 2, 3, 0, 11, 3, 1, 2, 1, 0, 1, 1, 7, 1, 0, 1, 0, 
0, 1, 4, 1, 4, 1, 0, 0, 1, 1, 1, 6, 1, 1, 1, 0, 0, 2, 9, 1, 0, 1, 0, 
1, 1, 8, 1, 1, 1, 0, 1, 1, 5, 2, 2, 2, 4, 1, 1, 1, 0, 1, 2, 7, 1, 1, 
0, 1, 0, 7, 1, 1, 1, 1, 3, 6, 0, 2, 0, 1, 1, 3, 6, 0, 1, 1, 1, 1, 1, 
10, 1, 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 10, 3, 0, 0, 0, 3, 15, 3, 
2, 2, 4, 2, 8, 4, 2, 3, 3, 5, 3, 1, 2, 1, 1, 1, 8,

As you see, it varies from 0 to 15 ticks. I believe this variability 
and the occasional large values is  responsible for the lurching in 
my TG.

If I use "myWait 0" I get:

1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 
0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 
1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 
1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 
0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 
0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 
0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0

I believe there must be something anomalous in the engine when running wait 0.

Jim



More information about the use-livecode mailing list