A multi-threaded CPU benchmark that measures floating-point and integer performance.
g++ -std=c++11 -O2 -pthread cpu_benchmark.cpp -o cpu_benchmark./cpu_benchmark [duration_seconds]duration_seconds- Optional. Time per test in seconds (default: 5)
./cpu_benchmark 10The benchmark runs four tests:
- Floating-point operations (all cores)
- Integer operations (all cores)
- Floating-point operations (single thread)
- Integer operations (single thread)
Results show MOPS (Million Operations per Second) for each test.