mirror of
https://github.com/metosin/reitit.git
synced 2026-01-23 22:59:02 +00:00
16 lines
470 B
Clojure
16 lines
470 B
Clojure
(ns reitit.perf-utils
|
|
(:require [criterium.core :as cc]))
|
|
|
|
(defn raw-title [color s]
|
|
(println (str color (apply str (repeat (count s) "#")) "\u001B[0m"))
|
|
(println (str color s "\u001B[0m"))
|
|
(println (str color (apply str (repeat (count s) "#")) "\u001B[0m")))
|
|
|
|
(def title (partial raw-title "\u001B[35m"))
|
|
(def suite (partial raw-title "\u001B[32m"))
|
|
|
|
(defmacro bench! [name & body]
|
|
`(do
|
|
(title ~name)
|
|
(println ~@body)
|
|
(cc/quick-bench ~@body)))
|