Initial Vexta Core v0.1.0 release
This commit is contained in:
commit
25c454329d
2481 changed files with 689289 additions and 0 deletions
22
src/bench/examples.cpp
Normal file
22
src/bench/examples.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2015-2020 The Bitcoin Core developers
|
||||
// Copyright (c) 2015-2020 The DigiByte 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 += sin(d);
|
||||
d += 0.000001;
|
||||
});
|
||||
}
|
||||
|
||||
BENCHMARK(Trig);
|
||||
Loading…
Reference in a new issue