Could someone please give me some help with limiting a loop to N iterations per minute in Python.
Lets say I have
limit = 5
for items in recvData:
# > limit iterations in past minute? -> sleep for 60 seconds from last iterations before proceeding? #
... do work ...
How would I do the time check / sleeping to give the correct flow. I’m not worried about blocking the executing thread/process while it waits.
Thanks
It should be noted that this is not “hard real time” code. this will be off slightly because of OS scheduling and the like. That being said, unless you know that you need hard real time, this should suffice.