"Dennis Lee Bieber" <wlfr...@ix.netcom.com> wrote in message 
news:1j1ebalmgkuskq0ltnv5m4sbm6d3p5f...@4ax.com...
>
> Pseudo (Python 2.x) code
>
> def aThread(delay=600.0): #default 10 minutes
>     while keepRunning:
>         print "thread triggered at %s" % time.time()
>         time.sleep(delay)
>     print "thread was commanded to exit"

I read a variation on this theme some years ago that uses 
event.wait(timeout=delay) to manage the delay.

>From the docs, "block until another thread calls set() to set the flag to 
true, or until the optional timeout occurs."

The benefit is that setting the flag terminates the loop straight away, as 
opposed to waiting for the sleep to finish.

I can show some sample code if anyone is interested.

Frank Millman



-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to