rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.6k stars 254 forks source link

Add timer unit argument for output time granularity specification #98

Closed cshaley closed 6 years ago

cshaley commented 7 years ago

Example test run: In:

def m():
    return [0]*10**8

In: %lprun -u 1e-3 -f m m()

Out: Timer unit: 0.001 s

Total time: 0.363548 s File: Function: m at line 1

Line # Hits Time Per Hit % Time Line Contents \============================================================== 1 def m(): 2 1 363.5 363.5 100.0 return [0]*10**8

Solution to #97

caethan commented 6 years ago

I like it! Can you update the docs to specify that the -u option takes the value in seconds?

cshaley commented 6 years ago

@caethan Just the readme? Those are the only docs I can find, and many of the arguments are not documented there either...

caethan commented 6 years ago

I just meant the docstring.

cshaley commented 6 years ago

Ok done.