diff options
Diffstat (limited to 'overlays')
-rwxr-xr-x | overlays/worktime/worktime/__main__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py index 30610b1d..79e1cbb7 100755 --- a/overlays/worktime/worktime/__main__.py +++ b/overlays/worktime/worktime/__main__.py | |||
@@ -47,7 +47,7 @@ import asyncio | |||
47 | from frozendict import frozendict | 47 | from frozendict import frozendict |
48 | from contextlib import closing | 48 | from contextlib import closing |
49 | import os | 49 | import os |
50 | import time | 50 | from time import clock_gettime_ns, CLOCK_MONOTONIC |
51 | from atomicwriter import AtomicWriter | 51 | from atomicwriter import AtomicWriter |
52 | 52 | ||
53 | class BearerAuth(requests.auth.AuthBase): | 53 | class BearerAuth(requests.auth.AuthBase): |
@@ -923,13 +923,13 @@ async def ui_update_options(api, cache_path): | |||
923 | sort_order = dict() | 923 | sort_order = dict() |
924 | entry_iter = enumerate(api.get_recent_entries()) | 924 | entry_iter = enumerate(api.get_recent_entries()) |
925 | loop = asyncio.get_event_loop() | 925 | loop = asyncio.get_event_loop() |
926 | start = time.clock_gettime_ns(time.CLOCK_MONOTONIC) | 926 | start = clock_gettime_ns(CLOCK_MONOTONIC) |
927 | while item := await loop.run_in_executor(None, next, entry_iter): | 927 | while item := await loop.run_in_executor(None, next, entry_iter): |
928 | ix, entry = item | 928 | ix, entry = item |
929 | if len(options) >= 20 or ix >= 1000: | 929 | if len(options) >= 20 or ix >= 1000: |
930 | break | 930 | break |
931 | elif len(options) >= 3: | 931 | elif len(options) >= 3: |
932 | now = time.clock_gettime_ns(time.CLOCK_MONOTONIC) | 932 | now = clock_gettime_ns(CLOCK_MONOTONIC) |
933 | if now - start >= 4000000000: | 933 | if now - start >= 4000000000: |
934 | break | 934 | break |
935 | 935 | ||