mode.timers — mode-ng 0.4.0 documentation

# `mode.timers`

AsyncIO Timers.

class mode.timers.Timer(interval: ~typing.Union[~datetime.timedelta, int, float, str], *, max_drift_correction: float = 0.1, name: str = '', clock: ~typing.Callable[[], float] = <built-in function perf_counter>, sleep: ~typing.Callable[[float], ~typing.Awaitable[None]] = <function sleep>)

  Timer state.

  adjust_interval(drift: float) → float
  interval: Union[timedelta, int, float, str]
  interval_s: float
  iteration: int
  last_wakeup_at: float
  last_yield_at: float
  max_drift: float
  max_interval_s: float
  min_interval_s: float
  on_before_yield() → None
  tick() → float