[squeak-dev] UTCDateAndTime updated for Squeak trunk Chronology and Spur (was: UTCDateAndTime updated for Squeak 4.6/5.0)

Bert Freudenberg bert at freudenbergs.de
Fri Mar 25 16:23:34 UTC 2016


On 25.03.2016, at 16:51, David T. Lewis <lewis at mail.msen.com> wrote:
> 
> On Thu, Mar 24, 2016 at 10:05:17PM -0700, Eliot Miranda wrote:
>> I see two or three system calls in the code below.  gettimeofday, one inside localtime and one inside gmtime.  That's expensive.
>> 
> 
> It's gettimeofday() and localtime(). The #else is fallback for older unix platforms.
> 
> In any case, caching the value and updating it periodically does not sound like a good idea to me.

Well, it’s okay to cheat as long as you won’t get caught (says DI).

Simply “once a second” is not good enough if we check the time 0.5 seconds after DST switch.

If “once a second” was implemented as “once every wall-clock second”, IMHO that would be fine. So the test would have to be something like

	(prevUsecs // 1000000) ~= (nowUsecs // 1000000) ifTrue: [self updateOffsetFromUTC]

Right?

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4207 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160325/ab061e83/smime.bin


More information about the Squeak-dev mailing list