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():
frequency = 400.0 # [Hz]
rate = aiorate.Rate(frequency, "my_rate_limiter")
event_loop = asyncio.get_event_loop()
while True:
print(f"Hello from loop at {asyncio.get_event_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.1.tar.gz
(11.4 kB
view details)
Built Distribution
aiorate-0.1-py3-none-any.whl
(6.8 kB
view details)
File details
Details for the file aiorate-0.1.tar.gz
.
File metadata
- Download URL: aiorate-0.1.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 | afe5846cbaa2960bd38ea03198d00965d66a08801607fd28d93a609f4121333b |
|
MD5 | 3ad3d7caf399a7268b876dbdd4ef6c3e |
|
BLAKE2b-256 | 822c0993ef1eb5045df1f0bb8ef3836e3c5a90de1a1be4b79317538627ce2546 |
File details
Details for the file aiorate-0.1-py3-none-any.whl
.
File metadata
- Download URL: aiorate-0.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.22.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb7d74eace267b331432d2f2207e7d2cd1b559a21736465f61e960098f4ee9f |
|
MD5 | 72d25a76552c61705c569c8969af400b |
|
BLAKE2b-256 | 50487027221a50d09463daa0f2742ceb3fa84f6d7a562e3f6ffbf95818869b56 |