diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-05-26 18:45:58 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-05-26 18:45:58 +0200 |
commit | 6babef7df913dc91066bf1ac8c7a1ad6b43acb3d (patch) | |
tree | 8cbc610f6cbcc7e17138a179ea792a7bf401261d | |
parent | 607a1c0af18e047f51e6f8f888449a9f2cecd167 (diff) | |
download | dabmod-6babef7df913dc91066bf1ac8c7a1ad6b43acb3d.tar.gz dabmod-6babef7df913dc91066bf1ac8c7a1ad6b43acb3d.tar.bz2 dabmod-6babef7df913dc91066bf1ac8c7a1ad6b43acb3d.zip |
Use system time instead of usrp time to print
-rw-r--r-- | src/OutputUHD.cpp | 5 | ||||
-rw-r--r-- | src/OutputUHD.h | 3 |
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); |