用装饰器打印输出的时间

def b(func):
def call_time(*args,**kwargs):
start_time=time.time()
ret=func(*args,**kwargs)
end_time=time.time()
c=end_time-start_time
print(c)
return call_time
posted @ 2018-06-05 23:16  孟庆健  阅读(507)  评论(0编辑  收藏  举报