 (defn random-error [prob]
   (when (< (rand) prob)
     (throw (Exception. "Simulated error"))))
-
-(defmacro time* [expr]
- `(do (println "Timing: " '~expr)
-      (time ~expr)))
 
 ;; globals
 

                         (or (:autofocus event)
                             (when-let [t (:wait-time-ms event)]
                               (pos? t))))]
    (filter identity ;; removes nil events
      (flatten
        (list
          #(log event)

(defn run-acquisition [this settings out-queue]
  (try
    (def acq-settings settings)
    (log (str "Starting MD Acquisition: " settings))
    (prepare-state this)
    (binding [state (.state this)]
      (def last-state state) ; for debugging
