using timers to force an execution time

Xavier Ho contact at xavierho.com
Thu Jul 16 06:49:07 EDT 2009


On Thu, Jul 16, 2009 at 6:34 PM, superpollo <user at example.net> wrote:

> hello.
>
> based upon previuos suggestions, i tried to write a program in which i
> would like to have a certain code fragment to execute only for a specified
> amount of time (say 3 seconds), then bail out.
>
> <snip>


> see? the while body ran for about 7 seconds... i bet it has to do with the
> fact that the timer does not control inner loops... any suggestion?
>
>
I'm guessing it has to do with a sleep of 0.66 seconds x 10 times = sleep
for 6.6 seconds, and then it checks for e.isSet().

Best regards,

Ching-Yun "Xavier" Ho, Technical Artist

Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: contact at xavierho.com
Website: http://xavierho.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090716/5eb781e8/attachment-0001.html>


More information about the Python-list mailing list