clodoc » clojure.core/time

Evaluates expr and prints the time it took.  Returns the value of
expr.
(defmacro time
  "Evaluates expr and prints the time it took.  Returns the value of
 expr."
  {:added "1.0"}
  [expr]
  `(let [start# (. System (nanoTime))
         ret# ~expr]
     (prn (str "Elapsed time: " (/ (double (- (. System (nanoTime)) start#)) 1000000.0) " msecs"))
     ret#))

Running Clodoc a92beda6 on Clojure 1.3.0
(C) 2010-2011 Jan Stępień
API Issues
Fork me on GitHub