Skip to content

Latest commit

Β 

History

History
35 lines (24 loc) Β· 782 Bytes

File metadata and controls

35 lines (24 loc) Β· 782 Bytes

CppBenchLite

πŸ§ͺ A lightweight, header-only C++ microbenchmarking library with optional multithreading and automatic iteration calibration.

πŸ”§ Features

  • Simple API: cppbench::benchmark(...)
  • Optional multithreaded execution
  • Auto mode: dynamically determines the optimal number of iterations
  • No dependencies β€” pure C++17
  • Easy to integrate into any project

πŸ“¦ Installation

Just copy include/cppbench.hpp into your project.

No build steps or external libraries needed.

πŸš€ Example

#include "cppbench.hpp"

void task() {
    // your code to benchmark
}

int main() {
    cppbench::Config cfg;
    cfg.auto_iterations = true;
    cfg.threads = 4;
    cfg.min_total_ms = 300;

    cppbench::benchmark("Auto-parallel benchmark", task, cfg);
}