This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Copyright (c) Frantisek Sodomka | |
;; Distributed under the Eclipse Public License, the same as Clojure. | |
(defmacro timings [n & exprs] | |
`(if (= ~@exprs) | |
~(vec (for [expr exprs] | |
`(let [start# (System/nanoTime) | |
ret# (dotimes [~'_ ~n] ~expr) | |
end# (System/nanoTime)] | |
{:expr '~expr |