(measure fname report f)
measures a form: => (t/measure "42 sum" println (reduce + (range 42))) "42 sum" took: 49,054 nanos 861
measures a form: => (t/measure "42 sum" println (reduce + (range 42))) "42 sum" took: 49,054 nanos 861
(str->date s)
(str->date s default)
parses string date in ISO 8601 if fails returns nil OR a default value when provided:
=> (str->date 42) nil
=> (str->date 42 epoch) ;; epoch is a value from this namespace #inst 1970-01-01T00:00:00.000-00:00
=> (str->date 2020-06-01T22:07:45.519Z epoch) #inst 2020-06-01T22:07:45.519-00:00
parses string date in ISO 8601 if fails returns nil OR a default value when provided: => (str->date 42) nil => (str->date 42 epoch) ;; epoch is a value from this namespace #inst 1970-01-01T00:00:00.000-00:00 => (str->date 2020-06-01T22:07:45.519Z epoch) #inst 2020-06-01T22:07:45.519-00:00
(time-it expr)
times a form and returns result and time it took in ms:
=> (t/time-it (reduce + (range 42))) [861 {:unit "ms", :time 0.049786}]
times a form and returns result and time it took in ms: => (t/time-it (reduce + (range 42))) [861 {:unit "ms", :time 0.049786}]
(sort-by :foo time< [{:foo t3} {:foo t2} {:foo t1}])
(sort-by :foo time< [{:foo t3} {:foo t2} {:foo t1}])
(sort-by :foo time> [{:foo t3} {:foo t2} {:foo t1}])
(sort-by :foo time> [{:foo t3} {:foo t2} {:foo t1}])
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close