noobCoder
noobCoder

Reputation: 94

is it possible to define a automatically changing variable?

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

Answers (2)

poggingfish
poggingfish

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

MVB76
MVB76

Reputation: 159

you can use sleep()

import time
func2()
time.sleep(600)
func1()

Upvotes: 0

Related Questions