Skip to main content

Timer classes with a focus on periodic timing in while loops

Reason this release was yanked:

unstable API

Project description

TickPy

Timer classes with a focus on periodic timing in while loops.

Usage

I use this module when I'm working with finite state machines, or in other words programs where the main function is a long-running while loop. My applications are usually pretty simple; most often I'm prototyping what will become a C program on a chip in python - this module lets me approximate that scenario pretty quickly.

It's all pretty simple stuff in here and it's a very small library - have a quick read of the code in the tickpy/ dir. In short, tickers are counters that update over a given interval, and timers track time in a more traditional sense. In both cases, functions are provided for operations like 'how long since' or 'has this period elapsed', and so on.

Testing

A test suite with complete coverage is available for this repo. It is implemented with pytest.

Plausible extensions

Things I can/will implement at request or my need:

  • extensions to period checking functions for both timer and ticker classes
    • extend ticker .cmod() to optionally take a period_start parameter - effectively decoupling period tracking from the start time when desired, and returning False if .counter has not yet reached period start.
  • optionally autoupdate when calling cmod and so on. Almost certainly ill-advised for the applications I envisage using this module for however.

Licence

GPL3 applies to all files and folders in this repo.

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

tickpy-0.4.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tickpy-0.4.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file tickpy-0.4.0.tar.gz.

File metadata

  • Download URL: tickpy-0.4.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for tickpy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4f7c89b3040325a78719993e887e7c228b8fbf86518a378ede877f2594166a61
MD5 d636cd7c27b2a2ad3ec57157ae6f0a13
BLAKE2b-256 146666147bbf5f37ab645607a5a25aa417868cb0b21abf9956a4428c4f4224ba

See more details on using hashes here.

File details

Details for the file tickpy-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: tickpy-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for tickpy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eac52da3af08aef839df8c28ddf58de3c71f88bf68441417aa8dbc9fa4ceb4ac
MD5 ba63b9b5145e766e5cd94879c56364bc
BLAKE2b-256 9adff8a513febb0569aa9c5958c23f25362d79421ba7a2c8b5253efa44e75ffc

See more details on using hashes here.

Supported by

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