diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-05-09 16:46:38 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-05-09 16:46:38 -0700 |
commit | 36be5216c237b15dbd00c17f33ac320192306882 (patch) | |
tree | cdd9e59cf9ce0dcbf18fdb991bad557b1c2dbc1f | |
parent | af488c5c2777d0cf4e2c835054b6f1dd8527b07c (diff) | |
download | uhd-36be5216c237b15dbd00c17f33ac320192306882.tar.gz uhd-36be5216c237b15dbd00c17f33ac320192306882.tar.bz2 uhd-36be5216c237b15dbd00c17f33ac320192306882.zip |
examples: Remove use of boost::posix_time from rx_ascii_art_dft
-rw-r--r-- | host/examples/rx_ascii_art_dft.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp index 26c84f52b..e242dbcd6 100644 --- a/host/examples/rx_ascii_art_dft.cpp +++ b/host/examples/rx_ascii_art_dft.cpp @@ -19,6 +19,7 @@ #include <thread> namespace po = boost::program_options; +using std::chrono::high_resolution_clock; int UHD_SAFE_MAIN(int argc, char *argv[]){ uhd::set_thread_priority_safe(); @@ -143,7 +144,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //------------------------------------------------------------------ initscr(); //curses init rx_stream->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); - boost::system_time next_refresh = boost::get_system_time(); + auto next_refresh = high_resolution_clock::now(); //------------------------------------------------------------------ //-- Main loop @@ -156,8 +157,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ if (num_rx_samps != buff.size()) continue; //check and update the display refresh condition - if (boost::get_system_time() < next_refresh) continue; - next_refresh = boost::get_system_time() + boost::posix_time::microseconds(long(1e6/frame_rate)); + if (high_resolution_clock::now() < next_refresh) { + continue; + } + next_refresh = + high_resolution_clock::now() + + std::chrono::microseconds(int64_t(1e6/frame_rate)); //calculate the dft and create the ascii art frame ascii_art_dft::log_pwr_dft_type lpdft( |