Skip to main content

No project description provided

Project description

interval-timer

An interval timer iterator that synchronises iterations to within specific time intervals.

The time taken for code execution within each iteration will not affect the interval timing, provided that the execution time is not longer than the interval period. The caller can check if this is the case by checking the missed attribute on the returned Interval instance.

Installation

pip install interval-timer

Usage

from interval_timer import IntervalTimer

for interval in IntervalTimer(1):
    print(interval)
    
    # Do time synchronised task once per second here...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interval-timer-0.3.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

interval_timer-0.3.0-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page