import functools
import time


def time_print(f):
    """It provides a wrapper to print the time cost on a process."""

    @functools.wraps(f)
    def g(*args, **kwargs):
        now = time.time()
        ret = f(*args, **kwargs)
        print(f.__name__, " cost time:", time.time() - now)
        return ret

    return g