From 5833c1dec8d193f63a234eca4b5b25439ee47806 Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 1 Jun 2018 17:58:57 +0300 Subject: [PATCH] cleaned bench source folder --- bench/Makefile | 3 +-- bench/spdlog-bench.cpp | 35 ----------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 bench/spdlog-bench.cpp diff --git a/bench/Makefile b/bench/Makefile index 3a80fd77..24a4d7b0 100644 --- a/bench/Makefile +++ b/bench/Makefile @@ -12,8 +12,7 @@ bench: bench.cpp spdlog-null-async: spdlog-null-async.cpp $(CXX) spdlog-null-async.cpp -o spdlog-null-async $(CXXFLAGS) $(CXX_RELEASE_FLAGS) - - + .PHONY: clean diff --git a/bench/spdlog-bench.cpp b/bench/spdlog-bench.cpp deleted file mode 100644 index 570581ca..00000000 --- a/bench/spdlog-bench.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// Copyright(c) 2015 Gabi Melman. -// Distributed under the MIT License (http://opensource.org/licenses/MIT) -// - -#include -#include - -#include "spdlog/sinks/simple_file_sink.h" -#include "spdlog/spdlog.h" - -int main(int, char *[]) -{ - using namespace std::chrono; - using clock = steady_clock; - - int howmany = 1000000; - - auto logger = spdlog::create("file_logger", "logs/spdlog-bench.log", false); - logger->set_pattern("[%Y-%m-%d %T.%F]: %L %v"); - - auto start = clock::now(); - for (int i = 0; i < howmany; ++i) - logger->info("spdlog message #{} : This is some text for your pleasure", i); - - duration delta = clock::now() - start; - float deltaf = delta.count(); - auto rate = howmany / deltaf; - - std::cout << "Total: " << howmany << std::endl; - std::cout << "Delta = " << std::fixed << deltaf << " seconds" << std::endl; - std::cout << "Rate = " << std::fixed << rate << "/sec" << std::endl; - - return 0; -}