TimeStamp Class

John M McIntosh johnmci at smalltalkconsulting.com
Fri Apr 8 01:19:52 UTC 2005


On Apr 7, 2005, at 4:45 PM, Daniel Salama wrote:

> I found this, in case anyone is interested in reading:
> http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-April/ 
> 024439.html
>
> John, I think you even posted that message.

John Maloney the original author of the mac vm posted that message.

Over time the Mac VM has used a number of different calls to get the  
millisecond time usually trying to reduce the overhead. The date/time  
was
calculated via a unix api call sequence (emulated under codewarrior)  
which was shown to be flawed in OS-X
since it (correctly & cheerfully) would report the local apparent time  
for your village in France which was 20 minutes ahead of Paris.
That was changed to use yet another set of unix api calls (used by the  
unix vm) that report time base on agreed time zones, yes yes we know  
the apparent time is 20 mins ahead of Paris, but you'll use the same  
time as Paris since you are in the same time zone as Paris, that was  
quite fun to debug. Picking a timezone & city in the date/time control  
has interesting side-effects.

I will note if you get the date/time and then the millisecond time it  
is possible that the difference between the two could be 0 to many  
dozen milliseconds because a
GC or full GC event could occur between those two primitive calls.   A  
before/after millisecond call bracketing the time/date call should tell  
you if the millisecond clock
is matching to the date/time if the difference is say zero or one  
milliseconds.

You could also make repeated calls to the date/time and then grab the  
millisecond clock when the time changes.

> --
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list