#include <util/time.h>
#include <compat.h>
#include <util/check.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <tinyformat.h>
#include <atomic>
#include <ctime>
#include <thread>
Go to the source code of this file.
◆ ChronoSanityCheck()
bool ChronoSanityCheck |
( |
| ) |
|
Sanity check epoch match normal Unix epoch.
Definition at line 30 of file time.cpp.
◆ FormatISO8601Date()
std::string FormatISO8601Date |
( |
int64_t |
nTime | ) |
|
◆ FormatISO8601DateTime()
std::string FormatISO8601DateTime |
( |
int64_t |
nTime | ) |
|
ISO 8601 formatting is preferred.
Use the FormatISO8601{DateTime,Date} helper functions if possible.
Definition at line 113 of file time.cpp.
◆ GetMockTime()
For testing.
Definition at line 97 of file time.cpp.
◆ GetSystemTime()
◆ GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
ClockType is
- std::chrono::steady_clock for steady time
- std::chrono::system_clock for system time
- NodeClock for mockable system time
Definition at line 109 of file time.cpp.
◆ GetTimeMicros()
Returns the system time (not mockable)
Definition at line 105 of file time.cpp.
◆ GetTimeMillis()
Returns the system time (not mockable)
Definition at line 101 of file time.cpp.
◆ MillisToTimeval() [1/2]
Convert milliseconds to a struct timeval for e.g.
select.
Definition at line 158 of file time.cpp.
◆ MillisToTimeval() [2/2]
Convert milliseconds to a struct timeval for e.g.
select.
Definition at line 165 of file time.cpp.
◆ nMockTime()
◆ ParseISO8601DateTime()
int64_t ParseISO8601DateTime |
( |
const std::string & |
str | ) |
|
◆ SetMockTime() [1/2]
DEPRECATED Use SetMockTime with chrono type.
- Parameters
-
[in] | nMockTimeIn | Time in seconds. |
Definition at line 89 of file time.cpp.
◆ SetMockTime() [2/2]
For testing.
Set e.g. with the setmocktime rpc, or -mocktime argument
Definition at line 94 of file time.cpp.
◆ UninterruptibleSleep()