mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
13 lines
316 B
Python
13 lines
316 B
Python
import time
|
|
|
|
import configs.timeouts
|
|
|
|
|
|
def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC) -> bool:
|
|
started_at = time.monotonic()
|
|
while not condition():
|
|
time.sleep(1)
|
|
if time.monotonic() - started_at > timeout_msec/1000:
|
|
return False
|
|
return True
|