MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / wrapper

Function wrapper

data/python/05_decorators.py:4–9  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

2
3def timer(func):
4 def wrapper(*args, **kwargs):
5 start = time.time()
6 result = func(*args, **kwargs)
7 end = time.time()
8 print(f"{func.__name__} took {end - start:.4f}s")
9 return result
10 return wrapper
11
12@timer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected