标签:时间 result turn rgs port star his 打印 name
1 import time 2 3 def timethis(func): 4 """ 5 测试函数运行花费时间的装饰器 6 """ 7 def wrapper(*args, **kwargs): 8 start = time.time() 9 result = func(*args, **kwargs) 10 end = time.time() 11 print("函数 %s 运行时间: %s" % func.__name__, end - start) 12 return result 13 return wrapper
标签:时间 result turn rgs port star his 打印 name
原文地址:http://www.cnblogs.com/tingshuo123/p/6917769.html