12 lines
241 B
Python
12 lines
241 B
Python
|
from threading import Timer
|
||
|
|
||
|
|
||
|
class Interval(Timer):
|
||
|
"""
|
||
|
From https://stackoverflow.com/a/48741004
|
||
|
"""
|
||
|
|
||
|
def run(self):
|
||
|
while not self.finished.wait(self.interval):
|
||
|
self.function(*self.args, **self.kwargs)
|