I need to use a timer which can be paused and resumed. As far as I know there is only one timer in Python which is contained in the threading
package, but I cannot pause or resume it, only cancel it.
This is a standard code to use the timer in Python:
from threading import Timer
import time
def timeout():
print "Game over"
t = Timer(20 * 60, timeout)
t.start()
So what should I do to realize pause/resume functions with this timer?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…