From c5686405959ac346a96f553eff74a68f3a94185c Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 27 May 2018 03:02:28 +0300 Subject: [PATCH] update bench --- bench/spdlog-null-async.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bench/spdlog-null-async.cpp b/bench/spdlog-null-async.cpp index 222881c7..ebdf10bf 100644 --- a/bench/spdlog-null-async.cpp +++ b/bench/spdlog-null-async.cpp @@ -63,17 +63,17 @@ int main(int argc, char *argv[]) cout << "*******************************************************************************\n"; size_t total_rate = 0; - + spdlog::init_thread_pool(tp_queue_size, tp_threads); for (int i = 0; i < iters; ++i) - { - spdlog::init_thread_pool(tp_queue_size, tp_threads); - // auto as = spdlog::daily_logger_st("as", "logs/daily_async"); - auto as = spdlog::create_async_logger("async(null-sink)"); + { + auto as = spdlog::create_async_logger("async(null-sink)"); total_rate += bench_as(howmany, as, client_threads); spdlog::drop("async(null-sink)"); + spdlog::details::registry::instance().get_thread_pool()->wait_empty (); } std::cout << endl; std::cout << "Avg rate: " << format(total_rate / iters) << "/sec" << std::endl; + } catch (std::exception &ex) {