From 6a6797e3aa9a85131d22d85082741d9aa82f1939 Mon Sep 17 00:00:00 2001 From: hanhxiao Date: Mon, 23 Sep 2019 18:20:00 +0800 Subject: [PATCH] fix: fix route table total time --- gnes/client/cli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gnes/client/cli.py b/gnes/client/cli.py index ada594ec..8f9acbf1 100644 --- a/gnes/client/cli.py +++ b/gnes/client/cli.py @@ -89,13 +89,12 @@ def update(self): elapsed_str = colored('elapsed', 'yellow') speed_str = colored('speed', 'yellow') self.num_bars += 1 - if self.num_bars > self.bar_len: - self.num_bars -= self.bar_len + if self.num_bars % self.bar_len == 0: sys.stdout.write('\n') sys.stdout.write( '{:>10} [{:<{}}] {:>8}: {:3.1f}s {:>8}: {:3.1f} batch/s'.format( colored(self.task_name, 'cyan'), - colored('=' * self.num_bars, 'green'), + colored('=' * int(self.num_bars % self.bar_len), 'green'), self.bar_len + 9, elapsed_str, elapsed,