@@ -94,11 +94,9 @@ void dna_adjust::AdjustPhasedMultiThread()
9494 initialiseIteration ();
9595
9696 std::string corr_msg;
97- std::ostringstream ss;
9897 UINT32 i;
9998 bool iterate (true );
10099
101- std::chrono::milliseconds iteration_time (std::chrono::milliseconds (0 ));
102100 cpu_timer it_time, tot_time;
103101
104102#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
@@ -169,7 +167,6 @@ void dna_adjust::AdjustPhasedMultiThread()
169167 for_each (mt_adjust_threads.begin (), mt_adjust_threads.end (), std::mem_fn (&std::thread::join));
170168#endif
171169 // This point is reached when the threads have finished
172- iteration_time = std::chrono::duration_cast<std::chrono::milliseconds>(it_time.elapsed ().wall );
173170
174171 // delete mt_adjust_threads;
175172#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
@@ -195,25 +192,20 @@ void dna_adjust::AdjustPhasedMultiThread()
195192 if (IsCancelled ())
196193 break ;
197194
198- ss.str (" " );
199- if (iteration_time >= std::chrono::seconds (1 )) {
200- auto seconds = std::chrono::duration_cast<std::chrono::seconds>(iteration_time);
201- ss << seconds.count () << " s" ;
202- } else {
203- ss << iteration_time.count () << " ms" ;
204- }
195+ std::string iteration_time_str = format_wall_time (it_time.elapsed ().wall );
205196
206197 // /////////////////////////////////
207198 // protected write to adj file (not needed here since write to
208199 // adj file at this stage is via single thread
209- adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Elapsed time" << ss. str () << std::endl;
200+ adj_file << std::setw (PRINT_VAR_PAD) << std::left << " Elapsed time" << iteration_time_str << std::endl;
210201 OutputLargestCorrection (corr_msg);
211202 // /////////////////////////////////
212203
213204 if (projectSettings_.g .verbose )
214205 debug_file << concurrentAdjustments.print_adjusted_blocks ();
215206
216207 iterationCorrections_.add_message (corr_msg);
208+ iterationTimes_.add_message (iteration_time_str);
217209 iterationQueue_.push_and_notify (CurrentIteration ()); // currentIteration begins at 1, so not zero-indexed
218210
219211 // continue iterating?
0 commit comments