Context manager to time operations
(operation_name: str)
| 10 | |
| 11 | @contextmanager |
| 12 | def timer(operation_name: str): |
| 13 | """Context manager to time operations""" |
| 14 | start = time.time() |
| 15 | try: |
| 16 | yield |
| 17 | finally: |
| 18 | duration = time.time() - start |
| 19 | logger.info(f"{operation_name} completed in {duration:.2f}s") |
| 20 | |
| 21 | class ProgressTracker: |
| 22 | """Tracks progress and performance metrics for batch operations""" |
no outgoing calls
no test coverage detected