[New-bugs-announce] [issue10377] cProfile incorrectly labels its output

Jean-Paul Calderone report at bugs.python.org
Tue Nov 9 20:15:57 CET 2010


New submission from Jean-Paul Calderone <invalid at example.invalid>:

Consider this transcript:

>>> cProfile.run("import time; time.sleep(1)")
         4 function calls in 1.012 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.011    0.011    1.012    1.012 <string>:1(<module>)
        1    0.000    0.000    1.012    1.012 {built-in method exec}
        1    1.001    1.001    1.001    1.001 {built-in method sleep}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}


>>> 

It is not the case that the profiled code uses >1 CPU seconds.  It spends the entire time sleeping.  The default timer for cProfile is a wallclock timer.  The output should reflect this.

----------
messages: 120890
nosy: exarkun
priority: normal
severity: normal
status: open
title: cProfile incorrectly labels its output
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10377>
_______________________________________


More information about the New-bugs-announce mailing list