Threads integer increment benchmark
#include <atomic>
#include <mutex>
class UnsynchronizedFixture
{
protected:
int counter;
};
class AtomicFixture
{
protected:
std::atomic<int> counter;
};
class MutexFixture
{
protected:
std::mutex mutex;
int counter;
};
{
++counter;
}
{
++counter;
}
{
std::scoped_lock lock(mutex);
++counter;
}
Settings & ThreadsRange(int from, int to)
Add new threads range to the benchmark running plan.
CppBenchmark definitions.
#define BENCHMARK_MAIN()
Benchmark main entry point macro.
#define BENCHMARK_THREADS_FIXTURE(fixture,...)
Benchmark threads with fixture register macro.