Skip to main content

LoopyTimer

Python looping timer. Forked from terryltang/pythonTimer

Install

pip install loopytimer

Feature & Usage

  • Require Python standard library: threading

  • Call a function after a specified number of seconds:

e.g.:
from loopytimer import LoopyTimer

timer = LoopyTimer(5.0, handler_func, args=[], kwargs={})
timer.set_call_limits(5)    # timer will run eternally if you don't set a limit
timer.start()
timer.cancel()     # cancel the timer's action if it's still waiting, will also destroy timer instance
  • Timer handler take positional arguments and keyword arguments:

e.g.:
timer = LoopyTimer(0.5, timer_handler, args=["Terry", "Tang"], kwargs={"city":"Houston", "state":"Texas"})
  • Cancel and destroy timer.

  • Add a customized logger function for timer handler.

  • Test cases included.

License

MIT License

Copyright (c) 2018 Wavky Huang

See -> LICENSE

Metadata

Release files for loopytimer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loopytimer 0.1.0
File Size Uploaded
loopytimer-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loopytimer 0.1.0
File Interpreter ABI Platform
loopytimer-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 9.9 kB

Release files / loopytimer-0.1.0.tar.gz

Download URL loopytimer-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7b6a183d0238451da9e6fdb1964f5a9ab5a266facdcac75475ce54515472ba12
BLAKE2b-256 checksum
How to use checksums
b0ca6378212484b14caf3c7a356a3ad1231c9aaf9812195483cd755fb62ef7c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / loopytimer-0.1.0-py2.py3-none-any.whl

Download URL loopytimer-0.1.0-py2.py3-none-any.whl
Size 5.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6444daf5da6be0f1720e0ca05e7c0cf956fa6bd00084df8f87dd592743fe04bc
BLAKE2b-256 checksum
How to use checksums
9fec50a9b89f4804b962ef86406982405d82e56826970ca3e6eec2d4a2865fab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page