def timeit(func, *args, **kw): def wrap(): print time.time() func(*args, **kw) print time.time() return wrap