On this page
  1. sched.scheduler
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

sched.scheduler

Up: sched
Rel: sched
Ref: docs.python.org — sched.scheduler
Tags: #public #python3 #stdlib #sched


Import

import sched
from sched import scheduler

Signature & Overview

sched.scheduler(timefunc=<built-in function monotonic>, delayfunc=<built-in function sleep>)

sched.scheduler class.

Methods & Attributes

Usage

import sched

clock = 0.0
out: list[float] = []
def advance(dt):
    global clock
    clock += dt
s = sched.scheduler(lambda: clock, advance)
s.enter(10.0, 1, lambda: out.append(clock))
s.run()
assert out == [10.0]

Gotchas

REPL Inspect

from sched import scheduler
help(scheduler)

Linked from

Related notes