def timeit(self, method):
""" Decorator for timing execution of a method
Returns:
function: the original function, wrapped
with a time accumulator
"""
def timed(*args, **kw):
ts = timer()
result = method(*args, **kw)
te = timer()
self.relevant_clock_time += te-ts
return result
return timed
评论列表
文章目录