Spaces:
Sleeping
Sleeping
File size: 319 Bytes
b2150c7 | 1 2 3 4 5 6 7 8 9 10 11 12 | import time
class AgentTimer:
def __init__(self, name):
self.name = name
def __enter__(self):
self.start = time.time()
def __exit__(self, exc_type, exc_val, exc_tb):
duration = time.time() - self.start
print(f"[{self.name}] completed in {duration:.2f}s") |