Ensure elapsed always >= 0.0 (just incase)

This commit is contained in:
Joshua Harlow
2015-06-02 11:48:03 -07:00
parent 00f75170b8
commit 8ea2f3d370

View File

@@ -36,7 +36,8 @@ class StopWatch(object):
t = self.stopped_at
else:
t = now()
return t - self.started_at
e = t - self.started_at
return max(0.0, e)
def __enter__(self):
self.start()