how to set timer

lynx a at b.c
Fri Sep 8 20:24:17 EDT 2000


"ykchew" <ykchew at hotmail.com>, in <39b8357f.0 at news.tm.net.my>:

>         i am developing a application that require to do some
>         calculation in every 10 seconds.
>        so, how can i set the timer in python??

you probably want os.signal. make your calculation the handler for
SIGALRM, then schedule an alarm (with os.signal.alarm()) for 10
seconds. make sure your handler schedules a new one before it exits!

alternatively, use threads maybe?



More information about the Python-list mailing list