 
   # Tells the server we are done benchmarking and halts all command processing.
   complete = ->
+    if isComplete
+      return
     if !uploading
+      isComplete = true
+      printInBrowser "\nTest complete. The browser will be killed now. Have " +
+                     "a wonderful day! :)\n"
       postToServer "complete"
       commands = []
     else # Need to wait for buffer upload to complete.
-      setTimeout complete 100
+      setTimeout complete, 10
 
   message = (text) ->
     outBuffer += text

  bufferSize = 1024
  commands = []
  uploading = false

  # Helper function for making errors purty.
  getErrorDetails = (url, type, data, textStatus, errorThrown) ->

  getFromServer("commands",
    ((data) ->
      commands = $.parseJSON(data)
      if not $.isArray commands
        error("Retrieved commands are not in an array format.")
    )
  )

  # When the console is 'clicked', the test begins. Doppio automatically clicks
  # the console when loading completes.
  container.click(-> extern.reprompt())

  return extern
