Add async sleep in sensor polling loop

'''
This commit enforces mandatory sleep of 20ms on completion of every polling loop for each eid. It will ensure mandatory CPU yield between 2 consecutive polling cycle.

Changes:
1. Add async sleep of 20ms when loop has already crossed polling time.
2. Add async sleep of 20ms when device goes offline to online, and then continue further polling.
3. Async sleep for 20ms and break the loop when the sensor on fron doesn't require update.

'''

Fixes nvbug https://nvbugs/5208433
signed-off-by: <ayushkumart@nvidia.com>
diff --git a/meson_options.txt b/meson_options.txt
index fe1567d..75f2837 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -75,7 +75,7 @@
     min: 1,
     max: 4294967295,
     description: 'Max allowable deviation in milliseconds from the desired polling interval. If within buffer, skip sleeping. Helps in minimizing delay.',
-    value: 5,
+    value: 20,
 )
 option(
     'inactive-sleep-time-in-ms',
diff --git a/nsmd/sensorManager.cpp b/nsmd/sensorManager.cpp
index 6b56afb..2c5fb20 100644
--- a/nsmd/sensorManager.cpp
+++ b/nsmd/sensorManager.cpp
@@ -678,6 +678,7 @@
                 nsmDevice->isDeviceActive = true;
                 co_await deviceManager.updateNsmDevice(nsmDevice, *foundEID);
                 co_await nsmDevice->setOnline();
+                co_await common::Sleep(event.get(), 20000, common::NonPriority);
                 continue;
             }
             else
@@ -788,7 +789,9 @@
             {
                 // Skip the RR-sensor
                 nsmDevice->roundRobinSensors.push_back(sensor);
-                continue;
+                co_await common::Sleep(event.get(), 20000, common::NonPriority);
+                sd_event_now(event.get(), CLOCK_MONOTONIC, &t1);
+                break;
             }
 
             // ServiceReady Logic:
@@ -830,15 +833,18 @@
         uint64_t diff = t1 - t0;
         if (diff > pollingTimeInUsec)
         {
-            // We have already crossed the polling interval. Don't sleep
+            // We have already crossed the polling interval. Complete mandatory
+            // sleep of 20ms then continue polling
+            co_await common::Sleep(event, 20000, timerEventPriority);
             continue;
         }
 
         uint64_t sleepDeltaInUsec = pollingTimeInUsec - diff;
         if (sleepDeltaInUsec < allowedBufferInUsec)
         {
-            // If the delta is within the allowed buffer, we can skip sleeping
-            // and continue polling.
+            // If the delta is within the allowed buffer, complete mandatory
+            // sleep of 20ms and continue then polling.
+            co_await common::Sleep(event, 20000, timerEventPriority);
             continue;
         }
         co_await common::Sleep(event, sleepDeltaInUsec, timerEventPriority);