Skip to main content

Loop frequency regulator for asyncio.

Project description

aiorate

build Documentation PyPI package Status

Loop frequency regulator for asyncio with an API similar to rospy.Rate.

Installation

pip install aiorate

Example

import asyncio
import aiorate

async def main():
    rate = aiorate.Rate(400.0)  # Hz
    while True:
        loop_time = asyncio.get_event_loop().time()
        print(f"Hello from loop at {loop_time:.3f} s")
        await rate.sleep()

if __name__ == "__main__":
    asyncio.run(main())

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

aiorate-0.3.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

aiorate-0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file aiorate-0.3.tar.gz.

File metadata

  • Download URL: aiorate-0.3.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for aiorate-0.3.tar.gz
Algorithm Hash digest
SHA256 47d38ba2b27ef21c849172abc6ac66ab6098d46656bbdf25560366a1b65ab3ec
MD5 f8ea187dd9fe5bf0e67fb18ec7c508f9
BLAKE2b-256 0d9f1511b493bde839de8200b95295a2ff4f312b5b4e1b5472c14660b073112d

See more details on using hashes here.

File details

Details for the file aiorate-0.3-py3-none-any.whl.

File metadata

  • Download URL: aiorate-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.22.0

File hashes

Hashes for aiorate-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7c2788306a022714956001dc436912b1428ef2601e349f9cc1169c1f2133b2
MD5 c63f5178b7906ceb5e0835048e153395
BLAKE2b-256 60711884ceddeaf565021e47fbe89c4bbb790f53eb66d62dd3d5254d50087620

See more details on using hashes here.

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