We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2008-02-29.02:03:04.772> created_at = <Date 2008-02-29.01:59:20.315> labels = ['type-bug', 'library'] title = 'os.times() returns incorrect value' updated_at = <Date 2008-02-29.14:09:42.223> user = 'https://bugs.python.org/kwatch'
bugs.python.org fields:
activity = <Date 2008-02-29.14:09:42.223> actor = 'georg.brandl' assignee = 'none' closed = True closed_date = <Date 2008-02-29.02:03:04.772> closer = 'facundobatista' components = ['Library (Lib)'] creation = <Date 2008-02-29.01:59:20.315> creator = 'kwatch' dependencies = [] files = ['9568'] hgrepos = [] issue_num = 2205 keywords = ['patch'] message_count = 4.0 messages = ['63116', '63117', '63118', '63137'] nosy_count = 3.0 nosy_names = ['georg.brandl', 'facundobatista', 'kwatch'] pr_nums = [] priority = 'normal' resolution = 'rejected' stage = None status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue2205' versions = ['Python 2.5']
The text was updated successfully, but these errors were encountered:
What?
Why you say that? What are you doing? What do you get? What do you expect? In which version of Python and in which Platform are you working?
Sorry, something went wrong.
I'm sorry to put empty submit.
os.time() returns incorrect value.
test.py:
def f(n): if n <= 0: return 1 else: return f(n-1) + f(n-2) import os t1 = os.times() f(34) t2 = os.times() utime = t2[0] - t1[0] stime = t2[1] - t1[1] total = utime + stime print "utime %.4f, stime %.4f, total %.4f" % (utime, stime, total)
result:
$ time python bench.py utime 38.6333, stime 0.1000, total 38.7333 real 0m23.787s user 0m23.211s sys 0m0.138s
This shows that real time is only 23.8 seconds, but os.times() reports that user time is over 38 seconds.
This is due to bug of Modules/posixmodule.c.
Environment: python 2.5.2, MacOS X 10.4 Tiger, GCC 4.0
See http://groups.google.com/group/comp.lang.python/browse_thread/thread/8032897a30781df/c656a79d4c3268a6 for details about this bug.
Isn't that tracked in bpo-1040026?
No branches or pull requests
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: