最内层函数返回的 r 能不能改成 f?
def new_f3(*args, **kwargs): t1 = time.time() r = f(*args, **kwargs) t2 = time.time() print('带参数计算函数运行时间call %s() in %f %s ' % (f.__name__, (t2 - t1),unit)) return f
def new_f3(*args, **kwargs): t1 = time.time() r = f(*args, **kwargs) t2 = time.time() print('带参数计算函数运行时间call %s() in %f %s ' % (f.__name__, (t2 - t1),unit)) return f
2018-08-03
举报