<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _loop(self):
 """ This is the loop that runs in the subproces. It is called from `run` and is responsible for all printing, text updates, and time management. """

        self.stop_flag.value = False
        self.time_started.value = time()
        self.time_elapsed.value = 0

        while True:
            if self.stop_flag.value:
                break
            self.update_text()
            with self.time_started.get_lock():
                start = self.time_started.value
                with self.time_elapsed.get_lock():
                    self.time_elapsed.value = time() - start
                    if (
                            self.timeout.value and
                            (self.time_elapsed.value > self.timeout.value)):
                        self.stop()
                        raise ProgressTimedOut(
                            self.name,
                            self.time_elapsed.value,
                        )