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

Function time_execution_async

mlx_use/utils.py:29–43  ·  view source on GitHub ↗
(
	additional_text: str = '',
)

Source from the content-addressed store, hash-verified

27
28
29def time_execution_async(
30 additional_text: str = '',
31) -> Callable[[Callable[P, Coroutine[Any, Any, R]]], Callable[P, Coroutine[Any, Any, R]]]:
32 def decorator(func: Callable[P, Coroutine[Any, Any, R]]) -> Callable[P, Coroutine[Any, Any, R]]:
33 @wraps(func)
34 async def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
35 start_time = time.time()
36 result = await func(*args, **kwargs)
37 execution_time = time.time() - start_time
38 logger.debug(f'{additional_text} Execution time: {execution_time:.2f} seconds')
39 return result
40
41 return wrapper
42
43 return decorator
44
45
46def singleton(cls):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected