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

threading.Timer

Prev: threading.ThreadError | Up: threading
Rel: threading.active_count, threading.Barrier, threading.BoundedSemaphore, threading.BrokenBarrierError
Ref: docs.python.org — threading.Timer
Tags: #public #python3 #stdlib #threading


Import

import threading
from threading import Timer

Signature & Overview

threading.Timer(interval, function, args=None, kwargs=None)

Call a function after a specified number of seconds: t = Timer(30.0, f, args=None, kwargs=None) t.start()

Methods & Attributes

Usage

import threading

fired = threading.Event()
t = threading.Timer(0.01, fired.set)
t.start()
assert fired.wait(timeout=2) is True
t.join()

Gotchas

REPL Inspect

from threading import Timer
help(Timer)

Linked from

Related notes