(defn
system-time
"Returns highest resolution time offered by host in milliseconds."
[]
(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) 1.0E9) (aget t 1)) 1000000.0))
:else
(.getTime (js/Date.))))