On 01.11.2011 14:03, Henry Vermaak wrote:
Also, how cheap is this on Windows? Presumably they will also have to
deal with potential system services running while updates fix daylight
saving time changes? If they don't use shared memory for this, I'd wager
that it's just as slow as libc localtime.

I've checked the Windows implementation. FPC's RTL in the end calls the function GetLocalTime which - as the name suggests - already returns the time that belongs to the current timezone (and DST settings). The implementation of that is cheap as well: the current bias from UTC is located in a shared memory section which the kernel maps into each running process. Thus only that one location (and the location were this setting is saved) is changed if a change of the timezone or the DST happens. So this is very cheap.

Note: for this I've looked into the source of ReactOS.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to