import functools
import threading


def setInterval(sec: int):
    """Time-interval based decorator

    usage: @setInterval(sec=3)
    """
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*argv, **kw):
            func(*argv, **kw)
            t = threading.Timer(sec, wrapper, argv, kw)
            t.start()
        return wrapper
    return decorator