Message110555
A patch including tests is in attachment.
Example usage:
>>> from cProfile import profile
>>>
>>> @profile
... def factorial(n):
... n = abs(int(n))
... if n < 1:
... n = 1
... x = 1
... for i in range(1, n+1):
... x = i * x
... return x
...
>>>
>>> factorial(5)
Thu Jul 15 20:58:21 2010 /tmp/tmpIDejr5
4 function calls in 0.000 CPU seconds
Ordered by: internal time, call count
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 0.000 0.000 profiler.py:120(factorial)
1 0.000 0.000 0.000 0.000 {range}
1 0.000 0.000 0.000 0.000 {abs}
1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}
120
>>>
Before including doc changes I'd like to hear whether this is actually desirable or not. |
|
Date |
User |
Action |
Args |
2010-07-17 14:01:14 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, collinwinter, pitrou |
2010-07-17 14:01:14 | giampaolo.rodola | set | messageid: <1279375274.49.0.102313390752.issue9285@psf.upfronthosting.co.za> |
2010-07-17 14:01:10 | giampaolo.rodola | link | issue9285 messages |
2010-07-17 14:01:10 | giampaolo.rodola | create | |
|