CallbackPrintTiming

class odl.solvers.util.callback.CallbackPrintTiming(fmt='Time elapsed = {:<5.03f} s', step=1, cumulative=False, **kwargs)[source]

Bases: odl.solvers.util.callback.Callback

Callback for printing the time elapsed since the previous iteration.

Methods

reset(self)

Set time to the current time.

__init__(self, fmt='Time elapsed = {:<5.03f} s', step=1, cumulative=False, \*\*kwargs)[source]

Initialize a new instance.

Parameters
fmtstring, optional

Formating that should be applied. The time is printed as

print(fmt.format(runtime))

where runtime is the runtime since the last iterate.

steppositive int, optional

Number of iterations between prints.

cumulativeboolean, optional

Print the time since the initialization instead of the last call.

Other Parameters
kwargs :

Key word arguments passed to the print function.