Loop frequency regulator for asyncio.
Project description
aiorate
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)
Built Distribution
aiorate-0.3-py3-none-any.whl
(7.1 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d38ba2b27ef21c849172abc6ac66ab6098d46656bbdf25560366a1b65ab3ec |
|
MD5 | f8ea187dd9fe5bf0e67fb18ec7c508f9 |
|
BLAKE2b-256 | 0d9f1511b493bde839de8200b95295a2ff4f312b5b4e1b5472c14660b073112d |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7c2788306a022714956001dc436912b1428ef2601e349f9cc1169c1f2133b2 |
|
MD5 | c63f5178b7906ceb5e0835048e153395 |
|
BLAKE2b-256 | 60711884ceddeaf565021e47fbe89c4bbb790f53eb66d62dd3d5254d50087620 |