Properly reset statistics counters between intervals.
write_time2 += threads[i].write_time2;
threads[i].read_count = threads[i].write_count = 0;
threads[i].read_time = threads[i].write_time = 0;
write_time2 += threads[i].write_time2;
threads[i].read_count = threads[i].write_count = 0;
threads[i].read_time = threads[i].write_time = 0;
+ threads[i].read_time2 = threads[i].write_time2 = 0;
pthread_mutex_unlock(&threads[i].lock);
}
pthread_mutex_unlock(&threads[i].lock);
}