Re: Time in milliseconds
Re: Time in milliseconds
- Subject: Re: Time in milliseconds
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 30 Jul 2004 10:58:11 -0700
On 7/30/04 8:14 AM, "Bill" <email@hidden> wrote:
>
> Is there any way to get the milliseconds part of date/time from
>
AppleScript.
>
>
>
> When I ask for current date, it gives me the day, date, month, year,
>
hours,
>
> minutes and seconds but not the milliseconds.
>
>
>
If you're using Mac OS X, you may try:
>
>
on milleDT()
>
try
>
do shell script "defaults read b"
>
on error errorText
>
text 1 thru 23 of errorText
>
end try
>
end milleDT
>
>
milleDT()
>
-- "2004-07-30 23:13:36.503"
Except you're going to waste many milliseconds, maybe even an entire second,
depending on your computer, memory, how busy it is, calling 'do shell
script' which is a standard addition with overhead. So if milliseconds
really matter to you, be ware that the result will not be correct. getting
an error is going to add more time. If it really, really matters to be
precise, better make an AppleScript Studio app and access the time via
Objective C methods (call method) which can get it to within 10,000ths of a
second precision.
--
Paul Berkowitz
_______________________________________________
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.