 
 ;; time
 
-(defn clock-ms []
+(defn jvm-time-ms []
   (quot (System/nanoTime) 1000000))
 
 (defn compute-time-from-core [tags]

    (not (core isContinuousFocusEnabled)))
      (core enableContinuousFocus true))
  (let [target-time (+ (@state :last-wake-time) interval-ms)
        delta (- target-time (clock-ms))]
    (when (pos? delta)
      (interruptible-sleep delta))
    (await-resume)
    (let [now (clock-ms)
          wake-time (if (> now (+ target-time 10)) now target-time)]
      (state-assoc! :last-wake-time wake-time))))


(defn store-new-z-reference []
  (let [z-drive (@state :default-z-drive)]
    (when (and (or (not (core isContinuousFocusEnabled))
                   (core isContinuousFocusDrive z-drive))
               (not (z-in-msp z-drive)))
      (state-assoc! :reference-z (get-z-stage-position z-drive)))))

;; startup and shutdown
