Skip to main content

time_it(func)

Signature: time_it(func: Callable[..., Any]) -> Callable[..., Any]

Decorator that times execution of func, prints the elapsed time, and returns the result.

Example

@time_it
function work() returns null {
# expensive work
}