StimBuff: Deferral: print message at start and end; timestamp too
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <config.h>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
@@ -56,7 +57,8 @@ public:
|
||||
: deviceAttachmentSpec(deviceAttachmentSpec),
|
||||
ringBuffer(nSlots, ringBufferConstraints),
|
||||
ioService(ioService_),
|
||||
shouldContinue(false), timer(ioService)
|
||||
shouldContinue(false), timer(ioService),
|
||||
nDeferrals(0)
|
||||
{}
|
||||
|
||||
virtual ~StimulusBuffer() = default;
|
||||
@@ -74,6 +76,7 @@ public:
|
||||
<< deviceAttachmentSpec->deviceSelector << std::endl;
|
||||
|
||||
shouldContinue = true;
|
||||
nDeferrals = 0;
|
||||
scheduleNextTimeout();
|
||||
}
|
||||
|
||||
@@ -107,6 +110,8 @@ private:
|
||||
SpinLock shouldContinueLock;
|
||||
bool shouldContinue;
|
||||
boost::asio::deadline_timer timer;
|
||||
size_t nDeferrals;
|
||||
std::chrono::high_resolution_clock::time_point deferralStartTime;
|
||||
|
||||
void scheduleNextTimeout(int delayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user