From: Francois Fleuret Date: Sun, 18 Jun 2017 10:11:27 +0000 (+0200) Subject: Fix. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=8cdea45a2a54fa619d670ff30cfdf96308853f7e;p=pysvrt.git Fix. --- diff --git a/cnn-svrt.py b/cnn-svrt.py index 142b81f..704b003 100755 --- a/cnn-svrt.py +++ b/cnn-svrt.py @@ -250,16 +250,18 @@ def int_to_suffix(n): class vignette_logger(): def __init__(self, delay_min = 60): self.start_t = time.time() + self.last_t = self.start_t self.delay_min = delay_min def __call__(self, n, m): t = time.time() - if t > self.start_t + self.delay_min: + if t > self.last_t + self.delay_min: dt = (t - self.start_t) / m log_string('sample_generation {:d} / {:d}'.format( m, n), ' [ETA ' + time.ctime(time.time() + dt * (n - m)) + ']' ) + self.last_t = t ######################################################################