From 4522434d938506b9abc029f8177202c948b98663 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Thu, 16 Jul 2020 13:47:52 +0100 Subject: [PATCH] Add time retrieval latency profile to CLI diagnostics (#2844) --- nano/node/cli.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nano/node/cli.cpp b/nano/node/cli.cpp index 8df2281c..2a6c6c66 100644 --- a/nano/node/cli.cpp +++ b/nano/node/cli.cpp @@ -614,6 +614,14 @@ std::error_code nano::handle_node_options (boost::program_options::variables_map nano::uint256_union junk2 (0); nano::kdf kdf; kdf.phs (junk1, "", junk2); + std::cout << "Testing time retrieval latency... " << std::flush; + nano::timer timer (nano::timer_state::started); + auto const iters = 2'000'000; + for (auto i (0); i < iters; ++i) + { + (void)std::chrono::steady_clock::now (); + } + std::cout << timer.stop ().count () / iters << " " << timer.unit () << std::endl; std::cout << "Dumping OpenCL information" << std::endl; bool error (false); nano::opencl_environment environment (error);