Reputation: 94
I want to run two function. first one is normally run all the time but every 10 minutes second function should run. So I planed to define a timer global variable. But i don't know whether it is possible or not if it is possible please guide me in a correct way if its not possible give alternative solution Here is what I've done so far
def func1():
"""something goes here"""
def func2():
"""something goes here"""
timer = """count down of 10 minutes"""
if timer<"""10 minutes""":
func1()
else:
func2()
Upvotes: 1
Views: 54
Reputation: 17
I would recommend time.sleep
import time
func2()
time.sleep(600)
The time library can be useful for a lot of things :)
-- Dylan
Upvotes: 1