From 38a7fa64f464084fa11708bdbe00cfabc311df29 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 9 May 2018 16:56:35 -0700 Subject: lib: Remove some unnecessary use of boost::posix_time Replace by std::chrono. --- host/lib/usrp/b200/b200_impl.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/b200') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 56b05a9ae..dac54bb05 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "../../transport/libusb1_base.hpp" @@ -34,7 +35,9 @@ using namespace uhd::usrp; using namespace uhd::usrp::gpio_atr; using namespace uhd::transport; -static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000); +namespace { + constexpr int64_t REENUMERATION_TIMEOUT_MS = 3000; +} // B200 + B210: class b200_ad9361_client_t : public ad9361_params { @@ -197,13 +200,14 @@ static device_addrs_t b200_find(const device_addr_t &hint) found++; } - const boost::system_time timeout_time = boost::get_system_time() + REENUMERATION_TIMEOUT_MS; - + const auto timeout_time = + std::chrono::steady_clock::now() + + std::chrono::milliseconds(REENUMERATION_TIMEOUT_MS); //search for the device until found or timeout - while (boost::get_system_time() < timeout_time and b200_addrs.empty() and found != 0) - { - for(usb_device_handle::sptr handle: get_b200_device_handles(hint)) - { + while (std::chrono::steady_clock::now() < timeout_time + and b200_addrs.empty() + and found != 0) { + for(usb_device_handle::sptr handle: get_b200_device_handles(hint)) { usb_control::sptr control; try{control = usb_control::make(handle, 0);} catch(const uhd::exception &){continue;} //ignore claimed -- cgit v1.2.3