hbp_nrp_commons.timer module

This module contains an implementation to run a certain function repeatedly until a timeout is reached

class hbp_nrp_commons.timer.Timer(interval: int, callback: Callable[[], None], **kwargs)[source]

Bases: threading.Thread

Timer that runs a function each ‘interval’ seconds similar to threading.Thread

cancel_all() → None[source]

Cancel the timer.

run() → None[source]

Exec the function and restart the timer.