Skip to content

Instantly share code, notes, and snippets.

@Jaretbinford
Created December 12, 2017 15:02
Show Gist options
  • Save Jaretbinford/d4a81f9dacc536348a18d9ea9d71492b to your computer and use it in GitHub Desktop.
Save Jaretbinford/d4a81f9dacc536348a18d9ea9d71492b to your computer and use it in GitHub Desktop.
(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