aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2020-05-04 08:15:43 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2020-05-04 12:26:20 -0500
commit717a51b34a3cbaabc9956cb1185483a0423bf628 (patch)
treeac7c8a3753a4ef33bd05d16a73cc7eeaf649293d /host
parentfa58c03208256790939460f8e37dd3aa5f3d07c0 (diff)
downloaduhd-717a51b34a3cbaabc9956cb1185483a0423bf628.tar.gz
uhd-717a51b34a3cbaabc9956cb1185483a0423bf628.tar.bz2
uhd-717a51b34a3cbaabc9956cb1185483a0423bf628.zip
uhd: Replaced deprecated usage of boost timer with std::chrono
replaced boost::timer by std::chrono::steady_timer to measure time interval
Diffstat (limited to 'host')
-rw-r--r--host/utils/converter_benchmark.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/host/utils/converter_benchmark.cpp b/host/utils/converter_benchmark.cpp
index f981455ac..cf266dfb2 100644
--- a/host/utils/converter_benchmark.cpp
+++ b/host/utils/converter_benchmark.cpp
@@ -14,7 +14,7 @@
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp>
-#include <boost/timer.hpp>
+#include <chrono>
#include <complex>
#include <iomanip>
#include <iostream>
@@ -200,11 +200,13 @@ double run_benchmark(converter::sptr conv,
size_t n_items,
size_t iterations)
{
- boost::timer benchmark_timer;
+ auto start = std::chrono::steady_clock::now();
for (size_t i = 0; i < iterations; i++) {
conv->conv(input_buf_refs, output_buf_refs, n_items);
}
- return benchmark_timer.elapsed();
+ auto stop = std::chrono::steady_clock::now();
+ std::chrono::duration<double> duration = stop - start;
+ return duration.count();
}
template <typename T>