diff options
Diffstat (limited to 'src/home/mqtt/util.py')
-rw-r--r-- | src/home/mqtt/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/home/mqtt/util.py b/src/home/mqtt/util.py new file mode 100644 index 0000000..f71ffd8 --- /dev/null +++ b/src/home/mqtt/util.py @@ -0,0 +1,8 @@ +import time + + +def poll_tick(freq): + t = time.time() + while True: + t += freq + yield max(t - time.time(), 0) |