mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-03 20:21:10 +00:00
no-functional changes. Only have set the priority level explicitly on every BENCHMARK macro call.
22 lines
543 B
C++
22 lines
543 B
C++
// Copyright (c) 2015-2020 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 <math.h>
|
|
|
|
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, benchmark::PriorityLevel::HIGH);
|