You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
time.clock () has very low resolution on Linux #57470
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2011-10-25.09:39:26.816>created_at=<Date2011-10-25.09:37:06.950>labels= ['type-bug']
title='time.clock () has very low resolution on Linux'updated_at=<Date2011-10-25.09:39:26.814>user='https://bugs.python.org/ellioh'
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.
Activity
ellioh commentedon Oct 25, 2011
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.
Currently on Linux I am using a workaround that is attached to the issue.
vstinner commentedon Oct 25, 2011
This issue is a duplicate of the issue bpo-10278.