def METHOD_NAME(self):
    print("Starting HAL thread", flush=True)
    while (True):
        start_time = datetime.now()
        # print(f"Calling update function inside hal thread")
        self.update_function()
        finish_time = datetime.now()
        dt = finish_time - start_time
        ms = (dt.days * 24 * 60 * 60 + dt.seconds) * \
            1000 + dt.microseconds / 1000.0
        if (ms < self.time_cycle):
            time.sleep((self.time_cycle - ms) / 1000.0)