Agent: Simplify logic in Timer.time_remaining
This commit is contained in:
parent
eb1a322ff8
commit
d3dd6ffeb0
|
@ -36,7 +36,7 @@ class Timer:
|
||||||
:rtype: float
|
:rtype: float
|
||||||
"""
|
"""
|
||||||
time_remaining = self._timeout_sec - (time.time() - self._start_time)
|
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):
|
def reset(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue