        (format "%d:%d:%d.%d" hours minutes seconds millis)))
 
 (defn display-final-stats [reqs-state]
+  "Print out a final summary of the current state of all requests"
   (let [state    @reqs-state
         stats    (rstate/stats reqs-state)
         started  (:bench-started-at state)

         (run [] (println @reqs-state)))]
    (.scheduleAtFixedRate (Timer.) task (long 0) (long 1000))))

(def console-timer (Timer.))

(defn format-time-duration [^Integer duration]
  (let [duration-secs (int (/ duration 1000))
        hours   (int (/ duration-secs 3600))

    (println "Total Runtime: " (format-time-duration duration))
    (println "Reqs/sec:"       (format "%f/sec" reqs-sec))))

(defn display-live-console-stats [reqs-state]
  "Print out a live console display of the current state of all requests"
  (println (rstate/stats reqs-state)))

(defn console [reqs-state ui-opts]
  "Dumps a summary of stats to the console"
  (let [task (proxy [TimerTask] []
         (run []
           (display-live-console-stats reqs-state)
           (cond (rstate/complete? reqs-state)
             (do
               (display-final-stats reqs-state)
               (.cancel this)))))]
    (.scheduleAtFixedRate (Timer.) task (long 0) (long 1000))))
