Test / module /runtime.py
Drbrain0620's picture
Upload folder using huggingface_hub
e3af2b1 verified
from contextlib import wraps as _wraps
from time import time as _time
def runtime(func):
@_wraps(func)
def wrapper(*args, **kwargs):
before = _time()
(ret:=func(*args, **kwargs))
print(f'function "{func.__name__}" took {_time() - before} seconds.')
return ret
return wrapper