with-timing

circumspec.runner

  • (with-timing & body)
Time body, which should return a map. Merge the execution
time into the result under the :nsec key.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source circumspec/runner.clj:34 top

(defmacro with-timing
  "Time body, which should return a map. Merge the execution
   time into the result under the :nsec key."
  [& body]
  `(let [start# (System/nanoTime)
         result# (do ~@body)]
     (assoc result# :nsec (- (System/nanoTime) start#))))
Vars in circumspec.runner/with-timing: defmacro - apply assoc concat let list seq vector
Used in 0 other vars

Comments top

No comments for with-timing. Log in to add a comment.