(time_current)
| 126 | |
| 127 | private |
| 128 | def show_progress(time_current) |
| 129 | n_finishes = @count_current - @count_previous |
| 130 | throughput = n_finishes.to_f / (time_current - @time_previous) |
| 131 | @time_previous = time_current |
| 132 | @count_previous = @count_current |
| 133 | |
| 134 | message = build_message(time_current, throughput) |
| 135 | $stderr.print("\r#{message}") if message |
| 136 | end |
| 137 | |
| 138 | def build_message(time_current, throughput) |
| 139 | percent = (@count_current / @count_max.to_f) * 100 |