pythonpython-2.7

I want to make a timer counting down in the background of my code


I am making a game in py2.7 and I want to know how to create a timer running in the background of my code and when time is up, a command is executed. Any help is appreciated.


Solution

  • You probably want threading.Timer. The sched module might also be useful.