[issue1040026] os.times() is bogus

Malte Helmert report at bugs.python.org
Sun Feb 24 03:13:38 CET 2008


Malte Helmert added the comment:

Alexander, regarding your comments:

1. sysconf in general returns a long because it can return all sorts of
information, but os.times() returns clock_t items, so the _SC_CLK_TCK
value must comfortably fit into a clock_t. It's preferable to cast into
a clock_t immediately rather than doing a conversion for each of the
ensuing divisions.

2. Do you have indications that such platforms exist? In that case,
indeed the patch should be adapted. Is that -1 return value documented
somewhere?

3. I agree; 0 or -1 would be better.

4. You're right about the overhead, but someone (amk?) measured it and
it's only 5% compared to the old buggy behaviour. It's still possible to
do a million calls to os.times() from Python in a second, which is
plenty fast enough. Clearly the speed could be improved, but it doesn't
appear worth the complications to me.

_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1040026>
_____________________________________


More information about the Python-bugs-list mailing list