MCPcopy Create free account
hub / github.com/browser-use/macOS-use / time_execution_sync

Function time_execution_sync

mlx_use/utils.py:14–26  ·  view source on GitHub ↗
(additional_text: str = '')

Source from the content-addressed store, hash-verified

12
13
14def 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
29def time_execution_async(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected