function | since v1.7.145 | Edit |
(system-time)
Returns highest resolution time offered by host in milliseconds.
(defn system-time
[]
(cond
(and (exists? js/performance)
(not (nil? (. js/performance -now))))
(.now js/performance)
(and (exists? js/process)
(not (nil? (. js/process -hrtime))))
(let [t (.hrtime js/process)]
(/ (+ (* (aget t 0) 1e9) (aget t 1)) 1e6))
:else (.getTime (js/Date.))))