Skip to content

Instantly share code, notes, and snippets.

@stereosupersonic
Created October 27, 2009 10:02
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 stereosupersonic/219445 to your computer and use it in GitHub Desktop.
Save stereosupersonic/219445 to your computer and use it in GitHub Desktop.
Progress
require "rubygems"
require "progressbar"
pbar = ProgressBar.new("Update Offer",big_array.size)
big_array.each do | e |
do_something
pbar.inc
end
###################### oder mit progress-monitor http://github.com/mikisvaz/progress-monitor
require "progress-monitor"
big_array.each do | e |
do_something
pbar.inc
end
## with inner loops
Progress.monitor("Main Loop")
(1..100).to_a.each{
Progress.monitor
(1..100).to_a.each{
sleep 0.05
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment