def timeit(method):
def timed(*args, **kw):<EOL><INDENT>time_start = time.time()<EOL>result = method(*args, **kw)<EOL>time_end = time.time()<EOL>print('<STR_LIT>' % (method.__name__, time_end-time_start, str(args)[:<NUM_LIT:20>], kw))<EOL>return result<EOL><DEDENT>return timed<EOL>
A Python decorator for printing out the execution time for a function.

Adapted from:
www.andreas-jung.com/contents/a-python-decorator-for-measuring-the-execution-time-of-methods