summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/OutputUHD.cpp5
-rw-r--r--src/OutputUHD.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 05d4484..87ea9c3 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -749,7 +749,8 @@ void UHDWorker::handle_frame(const struct UHDWorkerFrameData *frame)
tx_frame(frame, timestamp_discontinuity);
- if (last_usrp_time + 1.0 < usrp_time) {
+ auto time_now = std::chrono::steady_clock::now();
+ if (last_print_time + std::chrono::seconds(1) < time_now) {
if (num_underflows or num_late_packets) {
etiLog.log(info,
"OutputUHD status (usrp time: %f): "
@@ -760,7 +761,7 @@ void UHDWorker::handle_frame(const struct UHDWorkerFrameData *frame)
num_underflows = 0;
num_late_packets = 0;
- last_usrp_time = usrp_time;
+ last_print_time = time_now;
}
}
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index 6ebacef..6de945e 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -49,6 +49,7 @@ DESCRIPTION:
#include <uhd/usrp/multi_usrp.hpp>
#include <boost/thread.hpp>
#include <deque>
+#include <chrono>
#include <memory>
#include <string>
@@ -151,7 +152,7 @@ class UHDWorker {
uint32_t last_tx_pps;
// Used to print statistics once a second
- double last_usrp_time;
+ std::chrono::steady_clock::time_point last_print_time;
void print_async_metadata(const struct UHDWorkerFrameData *frame);