This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-14
Channels
- # announcements (31)
- # babashka (9)
- # beginners (4)
- # calva (67)
- # cider (6)
- # clj-yaml (10)
- # clojure (105)
- # clojure-austin (8)
- # clojure-bay-area (1)
- # clojure-europe (12)
- # clojure-germany (3)
- # clojure-nl (1)
- # clojure-norway (7)
- # clojure-uk (2)
- # clojurescript (5)
- # core-logic (4)
- # data-science (29)
- # datomic (6)
- # dev-tooling (5)
- # emacs (3)
- # hyperfiddle (22)
- # introduce-yourself (4)
- # lsp (8)
- # malli (10)
- # off-topic (8)
- # pathom (74)
- # polylith (39)
- # practicalli (1)
- # reitit (3)
- # shadow-cljs (2)
- # spacemacs (3)
- # squint (4)
- # tools-deps (4)
Is there an equivalent of time
that returns time as data instead of printing it?
Source is https://github.com/clojure/clojure/blob/clojure-1.10.1/src/clj/clojure/core.clj#L3884, so you could also snatch the part that generates the string
🙏 2
Miller, Halloway, & Bedra's Programming Clojure has a bench
macro which does this
(defmacro bench [expr]
`(let [start# (System/nanoTime)
result# ~expr]
{:result result#
:elapsed (- (System/nanoTime) start#)}))
(comment
(bench (str "a" "b"))
;; => {:elapsed 45125, :result "ab"}
)
🙏 2