line_profiler
line_profiler copied to clipboard
auto detect time units in kernprof -v output
Output now looks like this:
line # Hits Time Per Hit % Time Line Contents
====================================================================
11 @profile
12 def main():
13 1 13.0[µs] 13.0[µs] 0.0 wait(0)
14 1 102.1[ms] 102.1[ms] 8.5 wait(0.1)
15 1 1.1[s] 1.1[s] 91.5 wait(1.1)
Line # Hits Time Per Hit % Time Line Contents
================================================================
11 @profile
12 def main():
13 1 14.0µs 14.0µs 0.0 wait(0)
14 1 100.7ms 100.7ms 8.4 wait(0.1)
15 1 1.1s 1.1s 91.6 wait(1.1)