Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Clojure by

Very handy in CLJC projects especially to log long running operations. Happy to do PR(s).

  [expr msg]
  `(let [start# (. System (nanoTime))
         ret# ~expr]
     (prn (str msg (/ (double (- (. System (nanoTime)) start#)) 1000000.0) " msecs"))
     ret#))

Even better would be fmt-msg. (format msg-msg (/ (double (- (. System (nanoTime)) start#)) 1000000.0))

1 Answer

0 votes
by

I think if you want something more involved than what time does now, you should probably be rolling your own.

...