装饰器,计算时间差
import time
def performance(f):
def fn(*args, **kw):
t1 = time.time()
r = f(*args, **kw)
t2 = time.time()
print 'call %s() in %fs' % (f.__name__, (t2 - t1))
return r
return fn
其中的print 'call %s() in %fs' % (f.__name__, (t2 - t1))什么意思???