From 9df9bea6c1812fdc03ef8ace29859f0c64d382d2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 26 Apr 2018 14:43:12 -0700 Subject: lib: Purge some use of boost::system_time These are all timeout loops, which now use std::chrono::steady_clock::now() to check for timeout events. --- host/lib/usrp_clock/octoclock/octoclock_uart.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp_clock') diff --git a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp index 74d324645..7fc455dda 100644 --- a/host/lib/usrp_clock/octoclock/octoclock_uart.cpp +++ b/host/lib/usrp_clock/octoclock/octoclock_uart.cpp @@ -78,7 +78,9 @@ namespace uhd{ std::string octoclock_uart_iface::read_uart(double timeout){ std::string result; - boost::system_time exit_time = boost::get_system_time() + boost::posix_time::milliseconds(long(timeout*1e3)); + const auto exit_time = + std::chrono::steady_clock::now() + + std::chrono::milliseconds(int64_t(timeout*1e3)); while(true) { @@ -93,8 +95,7 @@ namespace uhd{ return result; } } - if (boost::get_system_time() > exit_time) - { + if (std::chrono::steady_clock::now() > exit_time) { break; } std::this_thread::sleep_for(std::chrono::milliseconds(1)); -- cgit v1.2.3