Changeset View
Changeset View
Standalone View
Standalone View
src/util/time.h
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
/** Returns the system time (not mockable) */ | /** Returns the system time (not mockable) */ | ||||
int64_t GetTimeMicros(); | int64_t GetTimeMicros(); | ||||
/** Returns the system time (not mockable) */ | /** Returns the system time (not mockable) */ | ||||
// Like GetTime(), but not mockable | // Like GetTime(), but not mockable | ||||
int64_t GetTimeSeconds(); | int64_t GetTimeSeconds(); | ||||
/** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */ | /** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */ | ||||
void SetMockTime(int64_t nMockTimeIn); | void SetMockTime(int64_t nMockTimeIn); | ||||
/** For testing */ | /** For testing */ | ||||
int64_t GetMockTime(); | std::chrono::seconds GetMockTime(); | ||||
/** Return system time (or mocked time, if set) */ | /** Return system time (or mocked time, if set) */ | ||||
template <typename T> T GetTime(); | template <typename T> T GetTime(); | ||||
/** | /** | ||||
* ISO 8601 formatting is preferred. Use the FormatISO8601{DateTime,Date} | * ISO 8601 formatting is preferred. Use the FormatISO8601{DateTime,Date} | ||||
* helper functions if possible. | * helper functions if possible. | ||||
*/ | */ | ||||
Show All 18 Lines |