Millisecond clock resolution for DateAndTime now
Avi Bryant
avi at beta4.com
Sun Sep 19 21:50:16 UTC 2004
On Sep 19, 2004, at 11:34 PM, John Pierce wrote:
> Hi all,
>
> I am trying to make sure I am not missing something, but I really
> would like DateAndTime now to return the current date/time with
> millisecond clock precision. I know there has been a lot of
> discussions on this in the past with folks desiring nanosecond
> precision -- but how about just millisecond precision from the system
> clock.
>
> Am I overlooking something or is this just not implemented on
> DateAndTime now?
The problem is that you don't know what the offset is between the
millisecond clock value and the current time in seconds. The only way
is to watch the millisecond clock and try to figure out what the value
is when the second clock ticks over. I posted a changeset that does
this calibration and gives DateAndTime now millisecond precision, but
at the time the decision was not to harvest it. You may still find it
useful, however:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2004-February/
074400.html
Avi
More information about the Squeak-dev
mailing list
|