diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-04-26 09:30:48 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-04-30 17:10:26 -0700 |
commit | 0303f1ed558b21e40f80c388b096432b4bf6e883 (patch) | |
tree | 05afcc4d2401bb86f9e38e3b04ec5b07e9268302 /host/examples/sync_to_gps.cpp | |
parent | fc67052345373c6d5c1b62064a9f9ef6f888e3ff (diff) | |
download | uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.gz uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.bz2 uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.zip |
lib: Purge all references to boost::this_thread::sleep()
Replace with std::this_thread::sleep_for().
Diffstat (limited to 'host/examples/sync_to_gps.cpp')
-rw-r--r-- | host/examples/sync_to_gps.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/host/examples/sync_to_gps.cpp b/host/examples/sync_to_gps.cpp index f76e0d3ca..0b7f030bc 100644 --- a/host/examples/sync_to_gps.cpp +++ b/host/examples/sync_to_gps.cpp @@ -9,8 +9,9 @@ #include <uhd/usrp/multi_usrp.hpp> #include <boost/format.hpp> #include <boost/program_options.hpp> -#include <boost/thread.hpp> #include <iostream> +#include <chrono> +#include <thread> namespace po = boost::program_options; @@ -80,7 +81,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) if (not ref_locked) { std::cout << "." << std::flush; - boost::this_thread::sleep(boost::posix_time::seconds(1)); + std::this_thread::sleep_for(std::chrono::seconds(1)); } } if(ref_locked) @@ -117,7 +118,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) //The wait is 2 seconds because N-Series has a known issue where //the time at the last PPS does not properly update at the PPS edge //when the time is actually set. - boost::this_thread::sleep(boost::posix_time::seconds(2)); + std::this_thread::sleep_for(std::chrono::seconds(2)); //Check times gps_time = uhd::time_spec_t(time_t(usrp->get_mboard_sensor("gps_time", mboard).to_int())); @@ -137,11 +138,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) uhd::time_spec_t time_last_pps = usrp->get_time_last_pps(); while (time_last_pps == usrp->get_time_last_pps()) { - boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } //Sleep a little to make sure all devices have seen a PPS edge - boost::this_thread::sleep(boost::posix_time::milliseconds(200)); + std::this_thread::sleep_for(std::chrono::milliseconds(200)); //Compare times across all mboards bool all_matched = true; |