mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
Changes: boost, easylogging, g2log, glog, spdlog.
This commit is contained in:
@@ -3,19 +3,37 @@
|
||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||
//
|
||||
|
||||
#include "easylogging++.h"
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
_INITIALIZE_EASYLOGGINGPP
|
||||
#include "easylogging++.h"
|
||||
#include "easylogging++.cc"
|
||||
INITIALIZE_EASYLOGGINGPP
|
||||
|
||||
int main(int, char *[])
|
||||
{
|
||||
using namespace std::chrono;
|
||||
using clock = steady_clock;
|
||||
|
||||
int howmany = 1000000;
|
||||
|
||||
// Load configuration from file
|
||||
el::Configurations conf("easyl.conf");
|
||||
el::Loggers::reconfigureLogger("default", conf);
|
||||
|
||||
el::Logger* defaultLogger = el::Loggers::getLogger("default");
|
||||
|
||||
auto start = clock::now();
|
||||
for (int i = 0; i < howmany; ++i)
|
||||
LOG(INFO) << "easylog message #" << i << ": This is some text for your pleasure";
|
||||
|
||||
duration<float> delta = clock::now() - start;
|
||||
float deltaf = delta.count();
|
||||
auto rate = howmany / deltaf;
|
||||
|
||||
std::cout << "Total: " << howmany << std::endl;
|
||||
std::cout << "Delta = " << deltaf << " seconds" << std::endl;
|
||||
std::cout << "Rate = " << rate << "/sec" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user