[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] RE: srfi-19 time, flonums and s11n
From: |
Kon Lovett |
Subject: |
Re: [Chicken-users] RE: srfi-19 time, flonums and s11n |
Date: |
Thu, 6 Sep 2007 07:52:10 -0700 |
On Sep 5, 2007, at 10:54 AM, Shawn Rutledge wrote:
On 9/5/07, Kon Lovett <address@hidden> wrote:
<snip>
Go ahead, but must have a mode where time-monotonic = time-tai.
That is required by the SRFI or some other spec, or just a convention
of this implementation?
"... a convention of " the " implementation ..." (All SRFI-19 impls
are based on the example AFAIK.)
If it is necessary to maintain this
equivalence, then maybe there should be a different type of time for
the alternate epoch; the SRFI says you can add different types beyond
the required ones.
Anyway I'm beginning to think that for my purpose flonums aren't so
bad after all; because two 32-bit ints take up the same space as one
double, but with doubles you can do math directly (faster on some
platforms than others) rather than having to write more logic to
handle the seconds and nanoseconds separately. So I will just store
the timestamp of an event as a plain flonum and worry later about what
forms it can be converted into. (And it's not necessary to load any
SRFI code that way.) For purposes of checking event order, a
comparison on a double would seem to be more efficient than either of
the SRFI time representations (SRFI-18 or 19). From an OO perspective
it's better to know what that number is rather than making an implicit
assumption, but whatever... I don't really like the complexity of both
implementations.
Ok. If you don't need a "calendar" then SRFI-19 is overkill, and
Chicken SRFI-18 'current-time' is the C library 'gettimeofday'.
http://en.wikipedia.org/wiki/Unix_time says Posix defines the
timestamp as seconds since 1970 without taking leap seconds into
account. So Posix time is identical to monotonic time as defined in
SRFI-19, right?
John Cowan said it.
Best Wishes,
Kon
_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] srfi-19 time, flonums and s11n, Shawn Rutledge, 2007/09/03
Re: [Chicken-users] srfi-19 time, flonums and s11n, john, 2007/09/03
Re: [Chicken-users] srfi-19 time, flonums and s11n, felix winkelmann, 2007/09/03