一:初识
import timedef fun1(): print("哈哈哈") time.sleep(2)def timer(f): def inner(): start_time=time.time() f() end_time=time.time() print(end_time-start_time) return innerf=timer(fun1)f()
python第九期学习笔记(装饰器)
原文:https://www.cnblogs.com/gaoyuxia/p/11755580.html