[Vm-dev] microsecond timing for GC work

John M McIntosh johnmci at smalltalkconsulting.com
Tue Jan 19 18:24:58 UTC 2010


Well this is using a sqlLong which is signed 64bit, the default choice is sqInt 32bit signed which won't last long. 
However I'm think more from a completeness viewpoint there should be a usqlLong  anyway. 

On 2010-01-19, at 4:02 AM, David T. Lewis wrote:

> I would not worry too much about using a sqLong here. If you report time
> in microseconds since the Posix epoch, you can go nearly 300 centuries
> before overflowing a 64 bit signed integer.
> 
>  bigLong := (2 raisedTo: 63) - 1.
>  biggestMicrosecAsSeconds := bigLong / 1000000.
>  secondsPerYear := 365.25 * 24 * 60 * 60.
>  maxYears := biggestMicrosecAsSeconds / secondsPerYear.
>  lastYear := 1970 + maxYears asInteger ==> 294241
> 
> Dave
> 

--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================






More information about the Vm-dev mailing list