Skip to content

Instantly share code, notes, and snippets.

@FND
Created May 26, 2011 08:36
Show Gist options
  • Save FND/992782 to your computer and use it in GitHub Desktop.
Save FND/992782 to your computer and use it in GitHub Desktop.
# adapted from http://snippets.dzone.com/posts/show/3760
total = 123
puts "starting #{total} conversions..."
reset = "\r" + "\e[0K"
(1..total).each do |i|
print "#{reset}#{i} / #{total}"
sleep(0.01)
$stdout.flush
end
print "#{reset}"
$stdout.flush
puts "conversion complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment