Determining actual elapsed (wall-clock) time
Bengt Richter
bokr at oz.net
Sun Jul 3 15:57:27 EDT 2005
On Sat, 2 Jul 2005 19:44:19 -0400, Tim Peters <tim.peters at gmail.com> wrote:
>[Peter Hansen]
>> Hmmm... not only that, but at least under XP the return value of
>> time.time() _is_ UTC. At least, it's entirely unaffected by the
>> daylight savings time change, or (apparently) by changes in time zone.
>
>On all platforms, time.time() returns the number of seconds "since the
>epoch". All POSIX systems agree on when "the epoch" began, but that
>doesn't really matter to your use case. Number of seconds since the
>epoch is insensitive to daylight time, time zone, leap seconds, etc.=20
>Users can nevertheless make it appear to jump (into the future or the
>past) by changing their system clock. If you need an absolute measure
>of time immune to user whims, you need to connect to special hardware,
>or to an external time source.
For the latter, Peter, you can probably adapt Paul Rubin' setclock.py
found at
http://www.nightsong.com/phr/python/setclock.py
Regards,
Bengt Richter
More information about the Python-list
mailing list