Agent: Simplify logic in Timer.time_remaining

This commit is contained in:
Mike Salvatore 2022-02-10 09:13:09 -05:00 committed by Ilija Lazoroski
parent eb1a322ff8
commit d3dd6ffeb0
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class Timer:
:rtype: float
"""
time_remaining = self._timeout_sec - (time.time() - self._start_time)
return time_remaining if time_remaining > 0 else 0
return max(time_remaining, 0)
def reset(self):
"""