mirror of
https://github.com/status-im/timbre.git
synced 2025-02-05 08:34:23 +00:00
Fix #47: incorrectly formatted nanosecond profiling times
This commit is contained in:
parent
e18ced6b2e
commit
c9b9b4a809
@ -194,7 +194,8 @@
|
|||||||
s-pattern (str "%" max-id-width "s %11s %9s %10s %9s %9s %7s %1s%n")
|
s-pattern (str "%" max-id-width "s %11s %9s %10s %9s %9s %7s %1s%n")
|
||||||
perc #(Math/round (/ %1 %2 0.01))
|
perc #(Math/round (/ %1 %2 0.01))
|
||||||
ft (fn [nanosecs]
|
ft (fn [nanosecs]
|
||||||
(let [pow #(Math/pow 10 %)
|
(let [nanosecs (long nanosecs) ; Truncate any fractional nanosecs
|
||||||
|
pow #(Math/pow 10 %)
|
||||||
ok-pow? #(>= nanosecs (pow %))
|
ok-pow? #(>= nanosecs (pow %))
|
||||||
to-pow #(encore/round (/ nanosecs (pow %1)) :round %2)]
|
to-pow #(encore/round (/ nanosecs (pow %1)) :round %2)]
|
||||||
(cond (ok-pow? 9) (str (to-pow 9 1) "s")
|
(cond (ok-pow? 9) (str (to-pow 9 1) "s")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user