From 6babef7df913dc91066bf1ac8c7a1ad6b43acb3d Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 26 May 2016 18:45:58 +0200 Subject: Use system time instead of usrp time to print --- src/OutputUHD.cpp | 5 +++-- src/OutputUHD.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 #include #include +#include #include #include @@ -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); -- cgit v1.2.3