MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / timer

Function timer

wan/utils/utils.py:380–387  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

378 return new_image
379
380def timer(func):
381 def wrapper(*args, **kwargs):
382 start_time = time.time()
383 result = func(*args, **kwargs)
384 end_time = time.time()
385 print(f"function {func.__name__} running for {end_time - start_time} seconds")
386 return result
387 return wrapper
388
389def timer_record(model_name=""):
390 def decorator(func):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected