import functools
import time


def timeit(text):
    """ Meauring function execution time and printing it."""
    def decorator_timeit(func):
        @functools.wraps(func)
        def timed(*args, **kw):
            ts = time.time()
            result = func(*args, **kw)
            te = time.time()
            timeresult = te-ts
            print(f"{text}::time spent {timeresult:.2f} seconds")
            return result

        return timed
    return decorator_timeit