Use monotonic for worker launch time tracking

This commit is contained in:
Kovid Goyal 2020-11-30 11:04:22 +05:30
parent b54aff0383
commit d0f617307f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -212,7 +212,7 @@ class Server(Thread):
self.start() self.start()
def launch_worker(self, gui=False, redirect_output=None, job_name=None): def launch_worker(self, gui=False, redirect_output=None, job_name=None):
start = time.time() start = time.monotonic()
with self._worker_launch_lock: with self._worker_launch_lock:
self.launched_worker_count += 1 self.launched_worker_count += 1
id = self.launched_worker_count id = self.launched_worker_count
@ -231,7 +231,7 @@ class Server(Thread):
if isinstance(cw, string_or_bytes): if isinstance(cw, string_or_bytes):
raise CriticalError('Failed to launch worker process:\n'+force_unicode(cw)) raise CriticalError('Failed to launch worker process:\n'+force_unicode(cw))
if DEBUG: if DEBUG:
print('Worker Launch took:', time.time() - start) print('Worker Launch took:', time.monotonic() - start)
return cw return cw
def do_launch(self, env, gui, redirect_output, rfile, job_name=None): def do_launch(self, env, gui, redirect_output, rfile, job_name=None):