Commit b34eef6e authored by Kevin's avatar Kevin Committed by Kai Chen
Browse files

fix ZeroDivisionError in progressbar (#162) (#163)

parent 0d00f1a6
......@@ -44,7 +44,10 @@ class ProgressBar(object):
def update(self):
self.completed += 1
elapsed = self.timer.since_start()
if elapsed > 0:
fps = self.completed / elapsed
else:
fps = float('inf')
if self.task_num > 0:
percentage = self.completed / float(self.task_num)
eta = int(elapsed * (1 - percentage) / percentage + 0.5)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment