Skip to main content

Limitloop is a lightweight python module for running loops that depend on precise timing.

Project description

Limitloop

Limitloop is a lightweight python module for running loops that depend on precise timing.

This package is available through Pypi and can be installed with the following command.

python -m pip install limitloop

Basic usage

All functionality of the module is provided through the limitloop.Loop class. This class is instantiated with a reference to a function, which it can then call at a consistent rate a preset number of times, or until otherwise interrupted. For example, the following code...

from limitloop import Loop

#Define a simple function for the Loop object to call
#This function must accept the loop object itself as its first argument
def demoFunction(loop):
    print('Hello, world!')

#Create our loop object, set to run at one iteration per second
l = Loop(demoFunction, freq=1)
#Call the function defined above 5 times
l.run(5)

...will output the following, one line per second.

Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!

See the API reference for more advanced usage.

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

limitloop-0.2.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file limitloop-0.2.tar.gz.

File metadata

  • Download URL: limitloop-0.2.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.3

File hashes

Hashes for limitloop-0.2.tar.gz
Algorithm Hash digest
SHA256 e38de175a4a201f82f7b24277cfb2f352ce1c7f3a963fdbead4f059a7c10307d
MD5 b9b659229f37204aa37d3c3a987b8dbe
BLAKE2b-256 bcc11e2732fedade70998c0a88f302ea68b70627b7ebb1e71bad7c251174a0d4

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