From aa7eda03311e219eb8eaccb242eb0657ec4d5fe5 Mon Sep 17 00:00:00 2001 From: Dhanji Prasanna Date: Fri, 17 Oct 2025 10:36:21 +1100 Subject: [PATCH] fix wall clock timing --- crates/g3-core/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/g3-core/src/lib.rs b/crates/g3-core/src/lib.rs index b5c2032..d9e06ea 100644 --- a/crates/g3-core/src/lib.rs +++ b/crates/g3-core/src/lib.rs @@ -1181,7 +1181,6 @@ The tool will execute immediately and you'll receive the result (success or erro let mut full_response = String::new(); let mut first_token_time: Option = None; let stream_start = Instant::now(); - let mut total_execution_time = Duration::new(0, 0); let mut iteration_count = 0; const MAX_ITERATIONS: usize = 400; // Prevent infinite loops let mut response_started = false; @@ -1546,7 +1545,6 @@ The tool will execute immediately and you'll receive the result (success or erro } }; let exec_duration = exec_start.elapsed(); - total_execution_time += exec_duration; // Track tool call metrics let tool_success = !tool_result.contains("❌"); @@ -1606,7 +1604,7 @@ The tool will execute immediately and you'll receive the result (success or erro format!( "{}\n\n🕝 {} | 💭 {}", full_response, - Self::format_duration(total_execution_time), + Self::format_duration(stream_start.elapsed()), Self::format_duration(_ttft) ) } else { @@ -1864,7 +1862,7 @@ The tool will execute immediately and you'll receive the result (success or erro format!( "{}\n\n⏱️ {} | 💭 {}", full_response, - Self::format_duration(total_execution_time), + Self::format_duration(stream_start.elapsed()), Self::format_duration(_ttft) ) } else { @@ -1956,7 +1954,7 @@ The tool will execute immediately and you'll receive the result (success or erro format!( "{}\n\n⏱️ {} | 💭 {}", full_response, - Self::format_duration(total_execution_time), + Self::format_duration(stream_start.elapsed()), Self::format_duration(_ttft) ) } else { @@ -1977,7 +1975,7 @@ The tool will execute immediately and you'll receive the result (success or erro format!( "{}\n\n⏱️ {} | 💭 {}", full_response, - Self::format_duration(total_execution_time), + Self::format_duration(stream_start.elapsed()), Self::format_duration(_ttft) ) } else {