Skip to content

Instantly share code, notes, and snippets.

@zentrope
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zentrope/8727273 to your computer and use it in GitHub Desktop.
Save zentrope/8727273 to your computer and use it in GitHub Desktop.
(loop [sec 0
good 0]
(let [{:keys [out exit] :as result} (ping! host)]
(print (if (zero? exit) "#" "."))
(flush)
(let [new-sec (inc sec)
clear? (= new-sec 60)
new-good (if (zero? exit) (inc good) good)]
(when clear?
(println (summarize good)))
(Thread/sleep 500)
(if clear?
(recur 0 0))
(recur new-sec new-good)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment