About the milliseconds function

Dar Scott dsc at swcp.com
Wed Apr 10 18:22:00 EDT 2002


On Wednesday, April 10, 2002, at 03:23 PM, Yates, Glen wrote:

> Or, perhaps you already received the message before you even 
> discovered the
> problem, and so not realizing its importance just ignored and 
> discarded it.

You were right!  I found it in the log.

Here it is:

> 4/23/02
> Dar,
>
> The problem is not in fields, it is in
> "the long time".  That function rounds
> to an even second (1000) the value
> that will be returned by an immediate
> subsequent call to milliseconds.
>
> The milliseconds accumulator counts up
> from there.
>
> This can give the illusion of negative
> time.  There is no negative time and
> you can't send messages into the past.
>
> Yourself Truly,
> Dar Scott

I checked this out and this seems to be the case on OS X, 
Revolution 1.1.1, on my Blue & White.  Also OS 9 in compatibility 
mode.

on mouseUp
   put empty into data
   repeat 1000 times
     put the milliseconds & linefeed after data
     put the milliseconds & linefeed after data
     put the long time & linefeed after data
     put the milliseconds & linefeed after data
     put the milliseconds & linefeed after data
     put the milliseconds & linefeed after data
   end repeat
   put data into field "ms"
end mouseUp

Here are the first few lines put into field "ms"

1018475299185
1018475299185
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299001
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299001
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299000
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299000
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299000
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299001
3:48:19 PM
1018475299000
1018475299000
1018475299000
1018475299000
1018475299001
3:48:19 PM
1018475299000
1018475299000
...

I tried it several times and, yes, the number used by milliseconds 
seems to be rounded by the long time.

Dar Scott




More information about the use-livecode mailing list