import functools
import time


def timeit(f):
    """Prints the time it takes to compute a function"""
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        t0 = time.time()
        result = f(*args, **kwargs)
        print('Executed {0!r} in {1:4f} s'.format(f.__name__, time.time() - t0))
        return result
    return wrapper