@shinyaz

Graph's result.execution_time returns 0ms — use node sum instead

1 min read

When checking execution time on a Strands Agents SDK Graph, result.execution_time returned 0ms. With 3 nodes taking over 15 seconds total, 0ms didn't make sense.

Python
result = graph("What is Amazon Bedrock?")
print(f"execution_time: {result.execution_time}ms")  # 0ms
total = sum(nr.execution_time for nr in result.results.values())
print(f"sum of node times: {total}ms")  # 15550ms

result.execution_time currently returns 0ms, but per-node execution_time is correctly recorded. To get total Graph execution time, use sum(nr.execution_time for nr in result.results.values()).

Swarm's result.execution_time works correctly, so this is Graph-specific. When comparing execution times across patterns, note that Graph requires manual node-time summation.

Share this post

Shinya Tahara

Shinya Tahara

Solutions Architect @ AWS

I'm a Solutions Architect at AWS, providing technical guidance primarily to financial industry customers. I share learnings about cloud architecture and AI/ML on this site.The views and opinions expressed on this site are my own and do not represent the official positions of my employer.