Changes: boost, easylogging, g2log, glog, spdlog.

This commit is contained in:
Alexander Kiselev
2018-03-19 19:22:02 +03:00
parent c83dd5d60e
commit 70ad1aa409
15 changed files with 212 additions and 46 deletions

View File

@@ -4,6 +4,8 @@
//
#include <atomic>
#include <chrono>
#include <iostream>
#include <thread>
#include <vector>
@@ -13,6 +15,8 @@ using namespace std;
int main(int argc, char *argv[])
{
using namespace std::chrono;
using clock = steady_clock;
int thread_count = 10;
if (argc > 1)
@@ -27,6 +31,7 @@ int main(int argc, char *argv[])
std::atomic<int> msg_counter{0};
vector<thread> threads;
auto start = clock::now();
for (int t = 0; t < thread_count; ++t)
{
threads.push_back(std::thread([&]() {
@@ -43,7 +48,16 @@ int main(int argc, char *argv[])
for (auto &t : threads)
{
t.join();
};
}
duration<float> delta = clock::now() - start;
float deltaf = delta.count();
auto rate = howmany / deltaf;
std::cout << "Total: " << howmany << std::endl;
std::cout << "Threads: " << thread_count << std::endl;
std::cout << "Delta = " << deltaf << " seconds" << std::endl;
std::cout << "Rate = " << rate << "/sec" << std::endl;
return 0;
}