Stop a task. This will freeze the elapsed time on the task. Args: task_id (TaskID): ID of task.
(self, task_id: TaskID)
| 1400 | task.start_time = self.get_time() |
| 1401 | |
| 1402 | def stop_task(self, task_id: TaskID) -> None: |
| 1403 | """Stop a task. |
| 1404 | |
| 1405 | This will freeze the elapsed time on the task. |
| 1406 | |
| 1407 | Args: |
| 1408 | task_id (TaskID): ID of task. |
| 1409 | """ |
| 1410 | with self._lock: |
| 1411 | task = self._tasks[task_id] |
| 1412 | current_time = self.get_time() |
| 1413 | if task.start_time is None: |
| 1414 | task.start_time = current_time |
| 1415 | task.stop_time = current_time |
| 1416 | |
| 1417 | def update( |
| 1418 | self, |