Windows XP - cron or scheduler for Python?

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Thu Jun 24 17:09:21 EDT 2004


Tim Golden wrote:

[...]
> s.start ()
> while 1:
>   try:
>     try:
>       pass
>     except KeyboardInterrupt:
>       break
>   finally:
>     s.stop ()

That's not a very good way of doing that.
This will eat 100% CPU time, it's a busy wait loop...
You should use time.sleep or something else to avoid
busy waiting.
But since you used the 'regular' Scheduler class from
Kronos, it will loop inside the s.start() by itself ... ;-)

--Irmen



More information about the Python-list mailing list