joyride
joyride copied to clipboard
Add `time` macro
Joyride doesn't come with the time
macro. nbb has this:
(defmacro time
"Async version of time."
[expr]
`(let [start# (cljs.core/system-time)
ret# ~expr
ret# (js/Promise.resolve ret#)]
(nbb.core/await
(.then ret# (fn [v#]
(prn (cljs.core/str "Elapsed time: "
(.toFixed (- (cljs.core/system-time) start#) 6)
" msecs"))
v#)))))
Anyway, @borkdude thinks SCI
should have it, so that is probably the best way to fix this.