Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
bench
examples.cpp
Go to the documentation of this file.
1
// Copyright (c) 2015-2016 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
bench/bench.h
>
6
7
// Extremely fast-running benchmark:
8
#include <cmath>
9
10
volatile
double
sum
= 0.0;
// volatile, global so not optimized away
11
12
static
void
Trig
(
benchmark::Bench
&
bench
) {
13
double
d = 0.01;
14
bench
.run([&] {
15
sum
+=
sin
(d);
16
d += 0.000001;
17
});
18
}
19
20
BENCHMARK
(
Trig
);
bench.h
BENCHMARK
#define BENCHMARK(n)
Definition
bench.h:65
ankerl::nanobench::Bench
Main entry point to nanobench's benchmarking facility.
Definition
nanobench.h:616
Trig
static void Trig(benchmark::Bench &bench)
Definition
examples.cpp:12
sum
volatile double sum
Definition
examples.cpp:10
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
Generated on Thu Dec 26 2024 02:38:01 for Bitcoin ABC by
1.9.8