From 1757b40bfe2b2d2f60dc66143fc0e9e11db2cb0e Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 3 Mar 2018 17:10:41 -0500 Subject: Cleanup. --- scripts/thready-time-signature.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/thready-time-signature.py b/scripts/thready-time-signature.py index 6d95d2b..e0e82b5 100755 --- a/scripts/thready-time-signature.py +++ b/scripts/thready-time-signature.py @@ -91,6 +91,7 @@ class Results(object): self.lock = threading.RLock() self.sum = datetime.timedelta(seconds = 0) self.t0 = datetime.datetime.now() + self.t1 = None self.n = 0 def add(self, t0, t1): @@ -111,7 +112,8 @@ class Results(object): def report(self): with self.lock: - self.t1 = datetime.datetime.now() + if self.t1 is None: + self.t1 = datetime.datetime.now() print "n {0.n} t0 {0.t0} t1 {0.t1} mean {0.mean} tmean {0.tmean}".format(self) -- cgit v1.2.3