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) {