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
| Name | Type | Description |
|---|---|---|
| func | Callable[..., 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
| Type | Description |
|---|---|
Callable[..., T] | A wrapped version of the input function that includes tracing and timing information. |