Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
util_time.cpp
Go to the documentation of this file.
1// Copyright (c) 2019 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#include <util/time.h>
8
10 bench.run([&] { (void)GetTime(); });
11}
12
14 SetMockTime(111);
16 SetMockTime(0);
17}
18
22
24 bench.run([&] { (void)GetTimeMillis(); });
25}
26
#define BENCHMARK(n)
Definition bench.h:65
Main entry point to nanobench's benchmarking facility.
Definition nanobench.h:616
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
int64_t GetTimeMillis()
Returns the system time (not mockable)
Definition time.cpp:101
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
Definition time.cpp:109
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
Definition time.cpp:89
static void BenchTimeMock(benchmark::Bench &bench)
Definition util_time.cpp:13
static void BenchTimeDeprecated(benchmark::Bench &bench)
Definition util_time.cpp:9
static void BenchTimeMillis(benchmark::Bench &bench)
Definition util_time.cpp:19
static void BenchTimeMillisSys(benchmark::Bench &bench)
Definition util_time.cpp:23