Commit ea3ac53b authored by Pavel Vainerman's avatar Pavel Vainerman

(ModbusTCP): небольшая оптимизация (при включённом выводе статистики обмена).…

(ModbusTCP): небольшая оптимизация (при включённом выводе статистики обмена). Вынес проверку таймера "вывода статистики" за цикл обмена...
parent 97896e51
...@@ -421,18 +421,15 @@ void MBTCPMaster::poll() ...@@ -421,18 +421,15 @@ void MBTCPMaster::poll()
} }
if( stat_time > 0 ) if( stat_time > 0 )
{
poll_count++; poll_count++;
if( ptStatistic.checkTime() ) }
if( stat_time > 0 && ptStatistic.checkTime() )
{ {
cout << endl << "(poll statistic): number of calls is " << poll_count << " (poll time: " << stat_time << " sec)" << endl << endl; cout << endl << "(poll statistic): number of calls is " << poll_count << " (poll time: " << stat_time << " sec)" << endl << endl;
ptStatistic.reset(); ptStatistic.reset();
poll_count=0; poll_count=0;
} }
}
// mb->disconnect();
}
{ {
uniset_mutex_lock l(pollMutex); uniset_mutex_lock l(pollMutex);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment