(additional_text: str = '')
| 12 | |
| 13 | |
| 14 | def time_execution_sync(additional_text: str = '') -> Callable[[Callable[P, R]], Callable[P, R]]: |
| 15 | def decorator(func: Callable[P, R]) -> Callable[P, R]: |
| 16 | @wraps(func) |
| 17 | def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: |
| 18 | start_time = time.time() |
| 19 | result = func(*args, **kwargs) |
| 20 | execution_time = time.time() - start_time |
| 21 | logger.debug(f'{additional_text} Execution time: {execution_time:.2f} seconds') |
| 22 | return result |
| 23 | |
| 24 | return wrapper |
| 25 | |
| 26 | return decorator |
| 27 | |
| 28 | |
| 29 | def time_execution_async( |
nothing calls this directly
no outgoing calls
no test coverage detected