     ; Note: as opposed to the vacation benchmark, we only support making
     ; reservations, not deleting customers or updating tables.
     (log "start reservation" (:id @reservation) "by worker" worker-id)
-    (process-reservation-par reservation data options secondary-workers)
+    (case (:version options)
+      :par
+        (process-reservation-par reservation data options secondary-workers)
+      ;seq
+        (process-reservation-seq reservation data options))
     (send master :done :reservation (:id @reservation))))
 
 (def done? (promise))
 
 (def master-waiting-behavior
   (behavior
-    [n]
+    [start-time n]
     [_done _key _id]
     ; _key is one of :reservation, :car, :flight, :room
     (if (= n 1)
       (do
+        (println "Total execution time:"
+          (/ (- (System/nanoTime) start-time) 1000) "ms")
         (log "done")
         #_(log-data data)
         (deliver done? true))
-      (become :same (dec n)))))
+      (become :same start-time (dec n)))))
 
 (def master-initial-behavior
   (behavior
-    [{:keys [n-workers n-secondary-workers n-reservations] :as options}]
+    [{:keys [version n-workers n-secondary-workers n-reservations] :as options}]
     [_start]
     (let [{:keys [reservations cars flights rooms] :as data}
             (initialize-data options)

  [reservation
   {:keys [cars flights rooms]}
   {:keys [n-queries]}
   workers]
  "Process a reservation: find a car, flight, and room for the reservation and
  update the data structures."
  (dosync
    (log "start tx for reservation" (:id @reservation))
    (send (rand-nth workers) :car    cars    reservation n-queries)
    (send (rand-nth workers) :flight flights reservation n-queries)
    (send (rand-nth workers) :room   rooms   reservation n-queries)
    (let [pnr (generate-pnr reservation)]
      (alter reservation assoc
        :status :in-process

; PARSE COMMAND LINE OPTIONS

(def cli-options
  [["-v" "--version X" "Version (seq, par)"
    ; TODO: rename "seq", because it's not sequential.
    ; There are two versions of this program, "seq" works similar to the
    ; original vacation benchmark, while "par" uses secondary worker actors.
    :default "seq"
    :validate [#(contains? #{"seq" "par"} %) "Must be seq or par"]]
   ["-w" "--workers N" "Number of workers"
    ; Workers are called clients in vacation, the option is -c there.
    :default 20
    :parse-fn #(Integer/parseInt %)]
