()
return inner
Return threaded timer
Return threaded timer
Return threaded timer
def t_timer():
    """
    Return threaded timer
    """

    class inner(object):
        def __init__(self, secs, **kwargs):
            self.secs = secs

        def __call__(self, func, *args, **kwargs):
            # The loop repeats the timer.
            def loop():
                ticker = threading.Event()
                while not ticker.wait(self.secs):
                    func(*args, **kwargs)

            # Run process in separate thread, once.
            logger.info(f"new time thread for function f{func} {args} {kwargs}")
            t = threading.Thread(target=loop, daemon=True)
            t.start()

    return inner
def t_timer ( ) : class inner ( object ) : def __init__ ( self , secs , * * kwargs ) : self . secs = secs def __call__ ( self , func , * args , * * kwargs ) : # The loop repeats the timer. def loop ( ) : ticker = threading . Event ( ) while not ticker . wait ( self . secs ) : func ( * args , * * kwargs ) # Run process in separate thread, once. logger . info ( f"new time thread for function f{func} {args} {kwargs}" ) t = threading . Thread ( target = loop , daemon = True ) t . start ( ) return inner