module documentation

This module provides a context manager to measure the elapsed time of a block of code. It can also be used as a decorator.

Example

with perfTimer(myCallback):
        # do something

@perfTimer(lambda ms: print(f'someFunction took: {ms} ms'))
def someFunction():
        # do something
Function perfTimer Meassure and print the elapsed time.
@contextmanager
def perfTimer(callback: Callable = print) -> Generator[None, None, None]: ΒΆ

Meassure and print the elapsed time.

Parameters
callback:CallableThe output callback function. It will receive the elapsed ms (float) as the only argument. Default is print.
Returns
Generator[None, None, None]Undocumented