more timer tweaks and simplifications

This commit is contained in:
Axel Kohlmeyer
2013-07-28 18:08:24 +02:00
parent f33aa0ad2d
commit 2b6468d976
6 changed files with 52 additions and 49 deletions

View File

@ -86,8 +86,13 @@ void Timer::_stamp(enum ttype which)
current_wall = MPI_Wtime();
if ((which > TOTAL) && (which < NUM_TIMER)) {
cpu_array[which] += current_cpu - previous_cpu;
wall_array[which] += current_wall - previous_wall;
const double delta_cpu = current_cpu - previous_cpu;
const double delta_wall = current_wall - previous_wall;
cpu_array[which] += delta_cpu;
wall_array[which] += delta_wall;
cpu_array[ALL] += delta_cpu;
wall_array[ALL] += delta_wall;
}
previous_cpu = current_cpu;