python execution something as the timer is running code example
Example 1: timer in python
timer = threading.Timer(interval, function, args = None, kwargs = None)
timer.start()
Example 2: python timer loop
import sched, time
s = sched.scheduler(time.time, time.sleep)
def do_something(sc):
print("Doing stuff...")
# do your stuff
s.enter(60, 1, do_something, (sc,))
s.enter(60, 1, do_something, (s,))
s.run()