MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / profile

Function profile

src/diffusion/logger.py:303–317  ·  view source on GitHub ↗

Usage: @profile("my_func") def my_func(): code

(n)

Source from the content-addressed store, hash-verified

301
302
303def profile(n):
304 """
305 Usage:
306 @profile("my_func")
307 def my_func(): code
308 """
309
310 def decorator_with_name(func):
311 def func_wrapper(*args, **kwargs):
312 with profile_kv(n):
313 return func(*args, **kwargs)
314
315 return func_wrapper
316
317 return decorator_with_name
318
319
320# ================================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected