让你的装饰工有光泽!
gloss的Python项目详细描述
安装
pip install glossy
开始装饰
importglossyimporttime@glossy.decoratordeftimer(func,*args,**kwargs):""" Timer Place this decorator on functions to see how long they take to execute. """start=time.time()result=func(*args,**kwargs)secs=time.time()-startname=func.__name__print(f"Function {name} took {secs} seconds")returnresult