From d32eed68de5ea17abc41cdbc90e4ef90ca0c7c4a Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sat, 19 Jul 2025 19:38:35 +0100 Subject: Add template for C++ benchmarks --- misc/dotfiles/templates/benchmark.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 misc/dotfiles/templates/benchmark.cpp (limited to 'misc/dotfiles/templates') diff --git a/misc/dotfiles/templates/benchmark.cpp b/misc/dotfiles/templates/benchmark.cpp new file mode 100644 index 0000000..ff0519b --- /dev/null +++ b/misc/dotfiles/templates/benchmark.cpp @@ -0,0 +1,17 @@ +#include + +static void BM_Baseline(benchmark::State& state) { + for (auto _ : state) { + __asm__("nop"); + } +} +BENCHMARK(BM_Baseline); + +static void BM_Treatment(benchmark::State& state) { + for (auto _ : state) { + __asm__("nop"); + } +} +BENCHMARK(BM_Treatment); + +BENCHMARK_MAIN(); -- cgit v1.2.3-70-g09d2