             [com.stuartsierra.component :as component])
   (:gen-class))
 
-; Let's start by implementing rendering a vec of layers on one static set of LEDs
+(defn now []
+  (System/currentTimeMillis))
 
 (def black {:r 0 :g 0 :b 0})
 (def white {:r 1 :g 1 :b 1})

              (recur))
          (println "Shutting down displayer"))))))


(defrecord ConsoleDisplayer [frame-chan prev-frame]
  component/Lifecycle
  (start [displayer]
    (let [displayer (-> displayer
                        (assoc :frame-chan (chan))
                        (assoc :prev-frame (atom nil)))]
      (start-displayer displayer)
      displayer))


    displayer)

  Displayer
  (display [{:keys [previous]} frame]
    (let [{prev-frame :frame prev-time :time} @previous]
      (when (and (>= (now) (+ prev-time console-display-interval))
                 (not= frame prev-frame))
        (reset! previous {:frame frame :time (now)})
        (println frame)))))


(defn get-env-updates [env]
  (-> env
      (assoc :time (now))))

(defn render-step [{:keys [env model] :as state}]
  (let [{:keys [layers]} model
