Context manager that times human interactions.
(self, node_id: str)
| 441 | |
| 442 | @contextmanager |
| 443 | def human_timer(self, node_id: str): |
| 444 | """Context manager that times human interactions.""" |
| 445 | self.__init_timers__() |
| 446 | start_time = time.time() |
| 447 | try: |
| 448 | yield |
| 449 | finally: |
| 450 | end_time = time.time() |
| 451 | duration = (end_time - start_time) |
| 452 | self._timers[f"human_{node_id}"] = duration |
| 453 | |
| 454 | @contextmanager |
| 455 | def tool_timer(self, node_id: str, tool_name: str): |
no test coverage detected