class_docstr: Combine time.time() or time.monotonic() with time.perf_counter() to get an
  absolute clock with fine resolution.
class_docstr_tok: ["Combine","time.time","(",")","or","time.monotonic","(",")","with","time.perf_counter","(",")","to","get","an","absolute","clock","with","fine","resolution","."]
code: def resync(self) -> None:
      _time = self.base_timer
      _perf_counter = timemod.perf_counter
      min_samples = 5
      while True:
          times = [
              (_time(), _perf_counter()) for _ in range(min_samples * 2)
          ]
          abs_times = collections.Counter(t[0] for t in times)
          first, nfirst = abs_times.most_common()[0]
          if nfirst < min_samples:
              # System too noisy? Start again
              continue
  
          perf_times = [t[1] for t in times if t[0] == first][:-1]
          assert len(perf_times) >= min_samples - 1, perf_times
          self.delta = first - sum(perf_times) / len(perf_times)
          break
  
imports: from __future__ import annotations
  import asyncio
  import collections
  import threading
  import time
  from collections.abc import Callable, Hashable, Iterator
  from contextlib import contextmanager
  from contextvars import ContextVar
  from dataclasses import dataclass
  from functools import wraps
  from math import nan
  from typing import Literal
  import psutil
  from distributed.compatibility import WINDOWS
label_desc: Use image node_id 3 for calling the _WindowsTime obj's underlying member method code with example usage: obj.resync() without return types