import time


def measure_time(func):
    """
    Decorator to measure the execution time of a function (func).

    """
    def func_wrapper(*args, **kwargs):

        start = time.time()
        ret = func(*args, **kwargs)
        stop = time.time()
        print("Time spent in function " + func.__name__ + ": " + str(stop - start))
        
        return ret

    return func_wrapper