Jonathan Shan wrote:
Hello,
I am trying to call a function every 5 seconds. My understanding of
time.sleep() is during the sleep time everything "stops". However, in
my application, there are background processes that must be running
continuously during the five second interval. Thus, threading.
hmm.. why use while True? After 5 secs, the function is going to run. so
t = threading.Thread(5.0, func)
t.start()
should just work. Put it in a infinite loop will start the thread and
then start a the stopped thread... forever.
Jim
On Jul 6, 2007, at 2:40 PM, Jonathan Shan wrote:
> Hello,
On Fri, 06 Jul 2007 14:40:16 -0700, Jonathan Shan wrote:
> I am trying to call a function every 5 seconds. My understanding of
> time.sleep() is during the sleep time everything "stops".
Not "everything", just the thread in which `sleep()` is called.
> However, in my application, there are backg
Hello,
I am trying to call a function every 5 seconds. My understanding of
time.sleep() is during the sleep time everything "stops". However, in
my application, there are background processes that must be running
continuously during the five second interval. Thus, threading.Timer
seems like a good