I need to program the execution of the give method every x minutes.
I found two ways to do this: the first uses the sched module, and the second uses Threading.Timer .
First method :
import sched, time s = sched.scheduler(time.time, time.sleep) def do_something(sc): print "Doing stuff..."
Second :
import threading def do_something(sc): print "Doing stuff..."
What is the difference and is one better than the other, which one?
python timer python-multithreading
farhawa
source share