Re: Millisecond clock
Re: Millisecond clock
- Subject: Re: Millisecond clock
- From: Emmanuel <email@hidden>
- Date: Tue, 9 Mar 2004 09:36:17 +0100
At 10:22 AM -0600 08/03/04, Adam Niese wrote:
>
Hi,
>
I need a way to consult a clock that tells time in milliseconds (preferably one that starts at 0 and can produce a useful integer) to schedule a series of simple events on the order of every 17-200 ms. Does anyone know how to create or where to find such a timer?
Since you got no better (public) reply I think I have to mention Smile. Smile proposes several mechanisms to produce such timings, but it was not designed with thorough timings in mind [1] so you'll observer some occasional lags. Here are the results when you ask a timing of 17 ms with no special precaution, with the "notify with delay" mechanism:
0.01884200002
0.018951999984
0.018893
0.018983999995
0.018945000018
0.018905000004
0.023145999992
0.019306000002
0.018917999987
0.01901400002
0.019019999978
0.019592000026
0.018945999997
0.018777999998
0.022234000004
0.019066999987
0.018909000006
0.018974999984
0.018758999999
0.018837000011
Here is what you get with "smilepause", another mechanism:
0.018634000007
0.019594000012
0.018707999989
0.019260000001
0.018748000002
0.01868899999
0.018826999993
0.018714000005
0.018553000002
0.018440999993
0.018700000015
0.018975999992
0.021064
0.018673000013
0.019356000004
0.018880999996
0.018647999997
0.018554999988
0.018702000001
0.01874
As you see, under OSX (it was not so under OS9), if you don't use a specific low-latency process you get from time to time a lag of 2-3 ms.
By "no precaution", I mean that I don't even time the script itself, so a more correct script would probably improve the results above by 0.001 or so.
Smile is the integrated development environment of fully-AppleScript automated solutions.
Satimage-software makes Smile available for free at:
<
http://www.satimage-software.com/en/smilex.html>
Emmanuel
[1] This is because SMI, the vision engine built on Smile uses its own clock, the FireWire camera. If you do require more accurate timings, maybe you could consider purchasing SMI.
_______________________________________________
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.