Debug the start of thread run in analysisthread. Sleep for appropriate amount of time.

This commit is contained in:
Isaac Connor 2020-12-15 15:57:40 -05:00
parent aaea6c6ead
commit 8a2d4c7512
1 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ AnalysisThread::~AnalysisThread() {
} }
int AnalysisThread::run() { int AnalysisThread::run() {
Debug(2, "AnalysisThread::run()");
useconds_t analysis_rate = monitor->GetAnalysisRate(); useconds_t analysis_rate = monitor->GetAnalysisRate();
Debug(2, "after getanalysisrate rate is %u", analysis_rate); Debug(2, "after getanalysisrate rate is %u", analysis_rate);
@ -41,8 +42,8 @@ int AnalysisThread::run() {
Debug(2, "Analyzing"); Debug(2, "Analyzing");
if ( !monitor->Analyse() ) { if ( !monitor->Analyse() ) {
Debug(2, "uSleeping for %d", 10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); Debug(2, "uSleeping for %d", (monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE));
usleep(10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); usleep((monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE));
} else if ( analysis_rate ) { } else if ( analysis_rate ) {
Debug(2, "uSleeping for %d", analysis_rate); Debug(2, "uSleeping for %d", analysis_rate);
usleep(analysis_rate); usleep(analysis_rate);