TimeStamp Class

John M McIntosh johnmci at smalltalkconsulting.com
Thu Apr 7 21:21:29 UTC 2005


This only returns the millisecond clock value which has started from  
some arbitrary point, and will roll over at some point either when it  
exceeds 536870911 or
at some decision made by the support VM based on hosting OS or hardware  
limitations.   See Time (class)>>millisecondsSince:  &  
millisecondsToRun: for logic to handle clock rollover. I recall in the  
past someone asked for access to the millisecond value as part of the  
second call (or another primitive). But I don't believe anything was  
done.

On Apr 7, 2005, at 1:45 PM, Joan Barrull wrote:

> Hope this helps:
>
>  3 timesRepeat: [ Transcript cr; show:DateAndTime  
> millisecondClockValue ]
>
>
> Regards,
>
>  joan
>
> On Apr 7, 2005 9:10 PM, Daniel Salama <dsalama at user.net> wrote:
>> I'm trying to get the difference of two TimeStamps objects and the  
>> best
>> accuracy I get is "asSeconds". When I try asMilliSeconds or
>> asNanoSeconds, the result is simply padded with 0s. Is there a better
>> way to get higher degree of accuracy? Maybe I'm just using the wrong
>> classes. For example:
>>
>> epoch := TimeStamp date: (Date readFromString: '01-01-1970') time:
>> (Time new).
>> Transcript clear.
>> 1 to: 20 do: [:i|
>>        Transcript cr; show: (((TimeStamp date: (Date today) time:  
>> (Time now))
>> - epoch) asMilliSeconds)
>> ].
>>
>> The idea behind is to get the number of milli seconds since the Epoch.
>> Is there a better way to do this?
>>
>> Thanks,
>> Daniel
>>
>>
>
>
--
======================================================================== 
===
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