Created
December 12, 2017 15:02
-
-
Save Jaretbinford/d4a81f9dacc536348a18d9ea9d71492b to your computer and use it in GitHub Desktop.
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
(require '[clojure.java.io :as io] | |
'[clojure.edn :as edn] | |
'[clojure.string :as str]) | |
(defn metaspace-burner | |
[timings-file] | |
(future | |
(with-open [f (io/writer (io/file timings-file))] | |
(binding [*out* f ] | |
(loop [] | |
(Thread/sleep 1) | |
(let [start (System/currentTimeMillis)] | |
(dotimes [_ 100] | |
(eval '(+ 1 1))) | |
(prn (- (System/currentTimeMillis) start))) | |
(recur)))))) | |
(comment | |
;; to start | |
(def run (metaspace-burner "timings.out"))) | |
(comment | |
;; to stop | |
(future-cancel run) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment