Loop frequency regulation for asyncio
Project description
aiorate
Loop frequency regulation 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.2.tar.gz
(11.4 kB
view details)
Built Distribution
aiorate-0.2-py3-none-any.whl
(6.9 kB
view details)
File details
Details for the file aiorate-0.2.tar.gz
.
File metadata
- Download URL: aiorate-0.2.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33cbed50c8f4262e828d8b86f84249d2a68b782ee5b130f3963fdc242ab9de69 |
|
MD5 | 5cea28e8380586722c268ad2eb4cf81c |
|
BLAKE2b-256 | 7ab9b54b465ddd51952f01c3ed740ba2915d107068bb9febbe8d5a3d2ba4a64d |
File details
Details for the file aiorate-0.2-py3-none-any.whl
.
File metadata
- Download URL: aiorate-0.2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89c585f0f7b6dedb5d3cbe981c2ed4db84406346a952a48e6a80f78951e7a0b4 |
|
MD5 | e3ad6b3b659074d9076003b10bd58393 |
|
BLAKE2b-256 | 6dfb2485f160d06fa77b001a8acd555d5aa842a213f5e8ae66e4ab3e9a8a5837 |