Changeset View
Changeset View
Standalone View
Standalone View
src/util/time.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
/** Returns the system time (not mockable) */ | /** Returns the system time (not mockable) */ | ||||
int64_t GetTimeMillis(); | int64_t GetTimeMillis(); | ||||
/** 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 */ | /** | ||||
* DEPRECATED | |||||
* Use SetMockTime with chrono type | |||||
* | |||||
* @param[in] nMockTimeIn Time in seconds. | |||||
*/ | |||||
void SetMockTime(int64_t nMockTimeIn); | void SetMockTime(int64_t nMockTimeIn); | ||||
/** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */ | |||||
void SetMockTime(std::chrono::seconds mock_time_in); | |||||
/** For testing */ | /** For testing */ | ||||
std::chrono::seconds 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} | ||||
Show All 20 Lines |