This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients anacrolix, belopolsky, brian.curtin, eric.araujo, glenn, kristjan.jonsson, michael.foord, pitrou, vstinner
Date 2011-10-25.09:40:55
SpamBayes Score 9.790089e-07
Marked as misclassified No
Message-id <1319535656.47.0.923136828921.issue10278@psf.upfronthosting.co.za>
In-reply-to
Content
The issue #13261 has been marked as a duplicate of this issue. Copy of msg146347:
-------------
time.clock () has very poor time resolution on Linux (tested on Ubuntu 11.04).

The result of call to clock () changes once per several seconds. On the other side, on Windows it provides very good resolution.

Here is a doctest that fails on Linux:
"""
 >>> from time import sleep
 >>> prev = clock ()
 >>> res = True
 >>> for i in xrange(10):
 ...     sleep(0.15)
 ...     next = clock ()
 ...     res = res and (next - prev) > 0.1
 ...     prev = next
 >>> print res
 True
"""

Currently on Linux I am using a workaround that is attached to the issue.
-------------

The issue has also a script:
http://bugs.python.org/file23515/monotime_unix.py
History
Date User Action Args
2011-10-25 09:40:56vstinnersetrecipients: + vstinner, belopolsky, pitrou, kristjan.jonsson, eric.araujo, michael.foord, brian.curtin, glenn, anacrolix
2011-10-25 09:40:56vstinnersetmessageid: <1319535656.47.0.923136828921.issue10278@psf.upfronthosting.co.za>
2011-10-25 09:40:55vstinnerlinkissue10278 messages
2011-10-25 09:40:55vstinnercreate