Re: Unixy question
Re: Unixy question
- Subject: Re: Unixy question
- From: garbanzito <email@hidden>
- Date: Mon, 20 May 2002 09:06:20 -0600
at 2002 05 19, 11:44 -0700, they whom i call John W Baxter wrote:
But none of that has anything to do with getting the time "with
microseconds" since date doesn't go below the second.
apropos time
leads us to the tantalizing Perl module Time::HiRes, which we don't have.
That module does provide a way to get the time including microseconds (in a
Perl script):
($seconds, $microseconds) = gettimeofday;
note that i posted perl code on this thread that does the
same syscall as Time::HiRes, but without needing any
additional perl modules. i simply pulled the numeric
constant for the appropriate syscall from the system
framework headers.
(this approach, by the way, is pure hacquery, but opens any
BSD syscall to use from AppleScript via perl without
downloading any modules.)
rereading the docs for gettimeofday(), i realize that i was
somewhat incorrect in stating the time resolution it
returned: it does return microseconds, but the printf %4 i
was using gave me only four decimal places.
using %6 will give the microseconds value reported by the
system, but doing this via do shell script & perl introduces
so much overhead that even milliseconds values will be below
the noise floor.
--
steve harley email@hidden
_______________________________________________
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.