Support update specific steps (#437)

pull/440/head
Yang Li 2020-07-20 11:36:00 +08:00 committed by GitHub
parent 82e5c8e552
commit 215a324414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -32,8 +32,9 @@ class ProgressBar:
self.file.flush()
self.timer = Timer()
def update(self):
self.completed += 1
def update(self, num_tasks=1):
assert num_tasks > 0
self.completed += num_tasks
elapsed = self.timer.since_start()
if elapsed > 0:
fps = self.completed / elapsed