![]() |
Bitcoin Core 28.99.0
P2P Digital Currency
|
Version of SteadyClock that is mockable in the context of tests (set the current value with SetMockTime), otherwise the system steady clock. More...
#include <time.h>
Public Types | |
using | time_point = std::chrono::time_point< MockableSteadyClock > |
Static Public Member Functions | |
static time_point | now () noexcept |
Return current system time or mocked time, if set. More... | |
static std::time_t | to_time_t (const time_point &)=delete |
static time_point | from_time_t (std::time_t)=delete |
static void | SetMockTime (std::chrono::milliseconds mock_time_in) |
Set mock time for testing. More... | |
static void | ClearMockTime () |
Clear mock time, go back to system steady clock. More... | |
Static Public Attributes | |
static constexpr std::chrono::milliseconds | INITIAL_MOCK_TIME {1} |
Version of SteadyClock that is mockable in the context of tests (set the current value with SetMockTime), otherwise the system steady clock.
using MockableSteadyClock::time_point = std::chrono::time_point<MockableSteadyClock> |
|
static |
|
staticdelete |
|
staticnoexcept |
|
static |
Set mock time for testing.
When mocking the steady clock, start at INITIAL_MOCK_TIME and add durations to elapse time as necessary for testing. To stop mocking, call ClearMockTime().
Definition at line 65 of file time.cpp.
|
staticdelete |
|
staticconstexpr |