Created
October 27, 2009 10:02
-
-
Save stereosupersonic/219445 to your computer and use it in GitHub Desktop.
Progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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