       :on-render ; the screen must be rendered (many times per second)
       (fn [screen entities]
         (println (:delta-time screen)) ; time (ms) elapsed since last frame
+        (println (:total-time screen)) ; time (ms) elapsed since :on-show
         entities)
       :on-hide ; the screen was replaced
       (fn [screen entities]


(defn ^:private reset-changed!
  [e-atom e-old e-new]
  (when (not= e-old e-new)
    (compare-and-set! e-atom e-old e-new)))

(defn ^:private normalize
  [entities]

                                     #(normalize (func screen-map old-entities))
                                     (meta func))
                                   (wrapper screen)
                                   (reset-changed! entities old-entities)
                                   (update-screen! @screen)))))
        update-fn! (fn [func args]
                     (doto (apply swap! screen func args)
                       update-screen!))]
    {:screen screen
     :entities entities
     :options options
     :show (fn []
             (update-fn! assoc
                         [:total-time 0
                          :update-fn! update-fn!
                          :execute-fn! execute-fn!
                          :on-timer on-timer
                          :input-listeners (input-listeners options execute-fn!)
                          :ui-listeners (ui-listeners options execute-fn!)])
             (execute-fn! on-show)
             (->> (contact-listener @screen options execute-fn!)
                  (swap! screen assoc :contact-listener)))
     :render (fn [d]
               (swap! screen #(assoc % :total-time (+ (:total-time %) d)))
               (execute-fn! on-render :delta-time d))
     :hide #(execute-fn! on-hide)
     :pause #(execute-fn! on-pause)
     :resize (fn [w h]
               (execute-fn! on-resize :width w :height h)
               (update-screen! @screen))
     :resume #(execute-fn! on-resume)}))

(defmacro defscreen
