From d0f617307f7d3ecb45b58d1ebd84624bc4a36edf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 30 Nov 2020 11:04:22 +0530 Subject: [PATCH] Use monotonic for worker launch time tracking --- src/calibre/utils/ipc/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/ipc/server.py b/src/calibre/utils/ipc/server.py index b9f5690dfd..50c81877af 100644 --- a/src/calibre/utils/ipc/server.py +++ b/src/calibre/utils/ipc/server.py @@ -212,7 +212,7 @@ class Server(Thread): self.start() def launch_worker(self, gui=False, redirect_output=None, job_name=None): - start = time.time() + start = time.monotonic() with self._worker_launch_lock: self.launched_worker_count += 1 id = self.launched_worker_count @@ -231,7 +231,7 @@ class Server(Thread): if isinstance(cw, string_or_bytes): raise CriticalError('Failed to launch worker process:\n'+force_unicode(cw)) if DEBUG: - print('Worker Launch took:', time.time() - start) + print('Worker Launch took:', time.monotonic() - start) return cw def do_launch(self, env, gui, redirect_output, rfile, job_name=None):