Skip to content

Instantly share code, notes, and snippets.

@zentrope zentrope/temp20140130.clj
Last active Aug 29, 2015

What would you like to do?
(loop [sec 0
good 0]
(let [{:keys [out exit] :as result} (ping! host)]
(print (if (zero? exit) "#" "."))
(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
You can’t perform that action at this time.