import time


def measure_time(func):
    """
    Exampls
    -----------
    >>> def myFunction(n):
    ...     time.sleep(n)
    ...     print("done")
    ...
    >>> measure_time(myFunction)(0.5)
    done
    Function took 0.5110921859741211 seconds to run
    """

    def wrapper(*arg, **kwargs):
        t = time.time()
        res = func(*arg, **kwargs)
        print("Function took " + str(time.time() - t) + " seconds to run")
        return res

    return wrapper