From 8a2d4c7512d10b9d77e77fac143af57c72dd1dcc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Dec 2020 15:57:40 -0500 Subject: [PATCH] Debug the start of thread run in analysisthread. Sleep for appropriate amount of time. --- src/zm_analysis_thread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zm_analysis_thread.cpp b/src/zm_analysis_thread.cpp index c7a5dbf55..69a019576 100644 --- a/src/zm_analysis_thread.cpp +++ b/src/zm_analysis_thread.cpp @@ -11,6 +11,7 @@ AnalysisThread::~AnalysisThread() { } int AnalysisThread::run() { + Debug(2, "AnalysisThread::run()"); useconds_t analysis_rate = monitor->GetAnalysisRate(); Debug(2, "after getanalysisrate rate is %u", analysis_rate); @@ -41,8 +42,8 @@ int AnalysisThread::run() { Debug(2, "Analyzing"); if ( !monitor->Analyse() ) { -Debug(2, "uSleeping for %d", 10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); - usleep(10*(monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); +Debug(2, "uSleeping for %d", (monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); + usleep((monitor->Active()?ZM_SAMPLE_RATE:ZM_SUSPENDED_RATE)); } else if ( analysis_rate ) { Debug(2, "uSleeping for %d", analysis_rate); usleep(analysis_rate);