Skip to main content

trace

A decorator that traces function execution with timing information. Works with regular functions, sync generators, async functions, and async generators/iterators.

def trace(
func: Callable[..., T]
) - > Callable[..., T]

A decorator that traces function execution with timing information. Works with regular functions, sync generators, async functions, and async generators/iterators.

Parameters

NameTypeDescription
funcCallable[..., T]The function to be traced. This can be a regular synchronous function, a synchronous generator, an asynchronous function, or an asynchronous generator/iterator.

Returns

TypeDescription
Callable[..., T]A wrapped version of the input function that includes tracing and timing information.