import functools
import time


def profile(some_function):
    """
    Wrapper that profiles the time spent in a function
    """

    @functools.wraps(some_function)
    def wrapper(*args, **kwargs):
        started_at = time.time()
        some_function(*args, **kwargs)
        print("Function {} took {:.4e}s".format(some_function.__name__, time.time() - started_at))

    return wrapper