From 5a1aed7957a5703759415b34e0644029c07d4185 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 10 Mar 2025 12:16:51 -0400 Subject: [PATCH] properly tally the SYNC time contributions to the ALL time entry this way its contribution is not double counted when determining the "Other" time data. --- src/timer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/timer.cpp b/src/timer.cpp index e448e73f2c..dea008a3c9 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -79,8 +79,12 @@ void Timer::_stamp(enum ttype which) if (_level > NORMAL) current_cpu = platform::cputime(); current_wall = platform::walltime(); - cpu_array[SYNC] += current_cpu - previous_cpu; - wall_array[SYNC] += current_wall - previous_wall; + const double delta_cpu = current_cpu - previous_cpu; + const double delta_wall = current_wall - previous_wall; + cpu_array[SYNC] += delta_cpu; + wall_array[SYNC] += delta_wall; + cpu_array[ALL] += delta_cpu; + wall_array[ALL] += delta_wall; previous_cpu = current_cpu; previous_wall = current_wall; }