Millisecond clock resolution for DateAndTime now

lex at cc.gatech.edu lex at cc.gatech.edu
Tue Sep 28 18:21:49 UTC 2004


John Pierce <john.raymond.pierce at gmail.com> wrote:
> So since I made the request should I fool around with the VM code and
> try to propose a modification or is someone else all over this?  Also
> -- what is the policy on VM mods?  Is there any chance we can have
> something like this in 3.8 or would the earliest be 3.9?  (assuming we
> had a clear path on the design and implementation and could implement
> it today).

No, most everyone is pretty much all talk at this point.

If you want, then go for it!  Champions make things happen.

I would suggest starting with a named plugin, but that's
because it seems simplest to me.  If a numbered prim is
simpler then sure why not?  I'm sure people will have lots of
suggestions about the final resting place of this primitive behavior, no
matter where your first version sticks it.

I think the elements so far agreed upon that the primitive should return
are:

	1. *Micro*second precision
	2. the offset to UTC
	3. a short string describing the timezone, e.g. 'EST'

(though I could be speaking from my own wishes, to some extent.)

Note that these are all optional to various degrees.  You can fill in
zero for the microseconds if the OS clock is only accurate to seconds. 
The offset to UTC can be completely bogus and imaginary.  And the
timezone string can be empty if there is no way to figure it out.  The
important thing, IMHO, is to get the interface right, so that the
details can be ironed out over time.

I think you can get #1 and #2 from gettimeofday.  Getting #3 I don't
know about; you may wish to find the source code for the "date" utility
and see how it does it.

-Lex



More information about the Squeak-dev mailing list