From df6e5863ec20501d0663fe15cd5309e22897506f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Sep 2024 12:18:16 +0530 Subject: [PATCH] Use monotonic_ns --- src/calibre/gui2/viewer/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/viewer/__init__.py b/src/calibre/gui2/viewer/__init__.py index 2872bb84b8..b321fb5539 100644 --- a/src/calibre/gui2/viewer/__init__.py +++ b/src/calibre/gui2/viewer/__init__.py @@ -3,7 +3,7 @@ import sys -from time import monotonic +from time import monotonic_ns from calibre.constants import DEBUG @@ -60,15 +60,15 @@ def url_for_book_in_library(): class PerformanceMonitor: def __init__(self): - self.start_time = monotonic() + self.start_time = monotonic_ns() def __call__(self, desc='', reset=False): if DEBUG: - at = monotonic() + at = monotonic_ns() if reset: self.start_time = at if desc: - ts = at - self.start_time + ts = (at - self.start_time) / 1e9 print(f'[{ts:.3f}] {desc}', file=sys.stderr)