Skip to content

Instantly share code, notes, and snippets.

@mping
Forked from ryfow/timing_load.clj
Created February 25, 2016 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mping/ae3a2608f041affb787a to your computer and use it in GitHub Desktop.
Save mping/ae3a2608f041affb787a to your computer and use it in GitHub Desktop.
(def ^:dynamic *indent* 0)
(alter-var-root
#'clojure.core/load
(fn [orig]
(fn [& paths]
(let [t (System/nanoTime)
r (binding [*indent* (inc *indent*)]
(apply orig paths))]
(binding [*out* *err*]
(println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime) t) 1000000.0) paths)
(flush))
r))))
(require 'clojure.core.async)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment