Files
bitcoin/src/bench/examples.cpp
MarcoFalke fa51a28a94 scripted-diff: Remove priority_level from BENCHMARK macro
-BEGIN VERIFY SCRIPT-

 sed --in-place --regexp-extended 's/BENCHMARK\(([^,]+), benchmark::PriorityLevel::(HIGH|LOW)\)/BENCHMARK(\1)/g' $( git grep -l PriorityLevel )
 sed --in-place                   's/#define BENCHMARK(n, priority_level)/#define BENCHMARK(n)/g'                ./src/bench/bench.h

-END VERIFY SCRIPT-
2026-01-13 08:33:37 +01:00

22 lines
513 B
C++

// Copyright (c) 2015-present The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <bench/bench.h>
// Extremely fast-running benchmark:
#include <cmath>
volatile double sum = 0.0; // volatile, global so not optimized away
static void Trig(benchmark::Bench& bench)
{
double d = 0.01;
bench.run([&] {
sum = sum + sin(d);
d += 0.000001;
});
}
BENCHMARK(Trig);