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

Make output timer unit more human friendly #97

Closed cshaley closed 6 years ago

cshaley commented 7 years ago

The timer unit in line_profiler defaults to 3.66538e-07 s on my computer. This makes it difficult for me to translate results into seconds. If a function took 287643 timer units to complete, I have to do math in order to actually understand that number.

In other words, I want to modify the reporting layer to output more user friendly times.

Approach options:

  1. Optional argument to set timer unit. e.g. -u 1e-6
  2. Optional argument to show times in ns, ms, us, s by default. e.g. 346.2ms, 1.2s, 999.0us instead of them all showing up with the same units.

@rkern thoughts?

w0rp commented 6 years ago

I too would like to see this. I find the numbers in the output hard to read.

cshaley commented 6 years ago

Issue resolved by #98