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.
This commit is contained in:
Axel Kohlmeyer
2025-03-10 12:16:51 -04:00
parent 6ff0f645e0
commit 5a1aed7957

View File

@ -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;
}