Skip to content

Instantly share code, notes, and snippets.

@nickserv
Created August 1, 2013 18:15
Show Gist options
  • Save nickserv/6133808 to your computer and use it in GitHub Desktop.
Save nickserv/6133808 to your computer and use it in GitHub Desktop.
A simple 5 second countdown in Ruby using carriage returns
$stdout.sync = true
5.downto(0).each do |index|
print "\rCountdown: #{index}"
sleep 1
end
print "\r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment