Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

crow wentlv at gmail.com
Wed Jun 18 05:52:34 EDT 2014


Hi.

I'm writing some scripts with python, and I found sometimes, when I try to use time.sleep(1) to sleep 1 sec, it would actually sleep for 9 secs or even longer.

>From python document, I saw this:

time.sleep(secs)
....
Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system. 

So, my question: under what kind of condition, time.sleep would suspend longer time than expected?

Anybody got interested?

Best Regards.



More information about the Python-list mailing list