sailfish.kernel.system.measure_time

sailfish.kernel.system.measure_time(mode: str) float[source]

A context manager to measure the execution time of a piece of code.

Example:

with measure_time() as duration:
    expensive_function()
print(f"execution took {duration()} seconds")