Check often if logUpdate has occured

This commit is contained in:
FlightlessMango 2020-06-21 13:47:22 +02:00
parent e957358786
commit 118a105aa4

View File

@ -104,8 +104,10 @@ void logging(void *params_void){
if (params->log_duration && (elapsedLog) >= params->log_duration * 1000000) if (params->log_duration && (elapsedLog) >= params->log_duration * 1000000)
loggingOn = false; loggingOn = false;
else else
this_thread::sleep_for(chrono::milliseconds(params->log_interval)); if (logUpdate)
this_thread::sleep_for(chrono::milliseconds(params->log_interval));
else
this_thread::sleep_for(chrono::milliseconds(0));
} }
writeFile(params->output_file + get_log_suffix()); writeFile(params->output_file + get_log_suffix());