[Python-ideas] time.wallclock() or other similar stuff

Kristján Valur Jónsson kristjan at ccpgames.com
Tue Nov 2 01:08:51 CET 2010

Bringing this in from python-dev, and http://bugs.python.org/issue10278

Summary:  time.clock() means two different things on Windows and Unix.  So, if you need to measure time across a blocking call in a portable way, you need to use time.time() (this fact is not documented).  Time.time has its own problems though, such as low resolution (compared to time.clock on windows) and being susceptible to being adjusted by the user.

I proposed adding a time.wallclock() to address this issue, which would be the most suitable function for the job on any platform.  The patch is an example implementation.  Any thoughts?  And yes, I acknowledge that the time module is complicated enough as it is :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20101102/7f10a21f/attachment.html>

More information about the Python-ideas mailing list