Register Timer#

Examples#

First, import Register utility from addon_utils submodule.

from .addon_utils import Register

Infinite Recurrent Timer#

@Register.TIMER(first_interval=0.0, step_interval=0.1, one_time_only=False, persistent=True)
def test_recurrent_timer_infinite(*args, **kwargs):
    print("Hello recurrent timer infinite")

Recurrent Timer with Timeout#

@Register.TIMER(first_interval=0.1, step_interval=0.1, timeout=1.0, one_time_only=False, persistent=True)
def test_recurrent_timer_with_timeout(*args, **kwargs):
    print("Hello recurrent timer with timeout")

One-Time with Delay#

@Register.TIMER(first_interval=1.0, one_time_only=True, persistent=False)
def test_one_time_timer_with_delay(*args, **kwargs):
    print("Hello one time timer with delay")