CallbackSleep¶
-
class
odl.solvers.util.callback.
CallbackSleep
(seconds=1.0)[source]¶ Bases:
odl.solvers.util.callback.Callback
Callback for sleeping for a specific time span.
Methods
reset
(self)Reset the callback to its initial state.
-
__init__
(self, seconds=1.0)[source]¶ Initialize a new instance.
- Parameters
- secondsfloat, optional
Number of seconds to sleep, can be float for subsecond precision.
Examples
Sleep 1 second between consecutive iterates:
>>> callback = CallbackSleep(seconds=1)
Sleep 10 ms between consecutive iterate:
>>> callback = CallbackSleep(seconds=0.01)
-