| Home | Trees | Indices | Help |
|
|---|
|
|
TimeOut helps manage timeouts that are spread across several operations.
Create it with the maximum amount of time you want to wait:>>> import time >>> timeout=TimeOut(0.5)
Calling the object will return the amount of time left: >>> time.sleep(.3) >>> timeout() # doctest:+SKIP 0.2
If you run out of time, calling a TimeOut will return zero: >>> time.sleep(.3) >>> timeout() 0.0
If you pass None as max_time, you get None back: >>> timeout=TimeOut(None) >>> timeout() is None True
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
| float or None |
end_time when time is up |
||
|
|||
|
Inherited from |
|||
|
|||
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Mon Mar 10 05:37:12 2008 | http://epydoc.sourceforge.net |