MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / print_timing

Function print_timing

codeclash/viewer/app.py:35–48  ·  view source on GitHub ↗

Decorator to log timing information for functions/routes

(func)

Source from the content-addressed store, hash-verified

33
34
35def print_timing(func):
36 """Decorator to log timing information for functions/routes"""
37
38 @functools.wraps(func)
39 def wrapper(*args, **kwargs):
40 start_time = time.time()
41 logger.info(f"Starting {func.__name__}")
42 try:
43 return func(*args, **kwargs)
44 finally:
45 elapsed = time.time() - start_time
46 logger.info(f"Completed {func.__name__} in {elapsed:.2f}s")
47
48 return wrapper
49
50
51class TimeoutError(Exception):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected