We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33dcb6c commit 8caf665Copy full SHA for 8caf665
XRPLib/timeout.py
@@ -1,20 +1,20 @@
1
import time
2
3
class Timeout:
4
- def __init__(self, timeout):
+ def __init__(self, timeout: float):
5
"""
6
Starts a timer that will expire after the given timeout.
7
8
:param timeout: The timeout, in seconds
9
:type timeout: float
10
11
- self.timeout = timeout
12
- self.start_time = time.time()
+ self.timeout = timeout*1000
+ self.start_time = time.ticks_ms()
13
14
def is_done(self):
15
16
:return: True if the timeout has expired, False otherwise
17
18
if self.timeout is None:
19
return False
20
- return time.time() - self.start_time > self.timeout
+ return time.ticks_ms() - self.start_time > self.timeout
0 commit comments