![]() |
Bitcoin Core 31.1.0
P2P Digital Currency
|
#include <util/time.h>#include <compat/compat.h>#include <tinyformat.h>#include <util/check.h>#include <util/strencodings.h>#include <array>#include <atomic>#include <chrono>#include <optional>#include <string>#include <string_view>#include <thread>Go to the source code of this file.
Functions | |
| void | UninterruptibleSleep (const std::chrono::microseconds &n) |
| void | SetMockTime (int64_t nMockTimeIn) |
| DEPRECATED Use SetMockTime with chrono type. | |
| void | SetMockTime (std::chrono::time_point< NodeClock, std::chrono::seconds > mock) |
| void | SetMockTime (std::chrono::seconds mock_time_in) |
| For testing. | |
| std::chrono::seconds | GetMockTime () |
| For testing. | |
| int64_t | GetTime () |
| DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed. | |
| std::string | FormatISO8601DateTime (int64_t nTime) |
| ISO 8601 formatting is preferred. | |
| std::string | FormatISO8601Date (int64_t nTime) |
| std::optional< int64_t > | ParseISO8601DateTime (std::string_view str) |
| std::string | FormatRFC1123DateTime (int64_t time) |
| RFC1123 formatting https://www.rfc-editor.org/rfc/rfc1123#section-5.2.14 Used in HTTP/1.1 responses. | |
| struct timeval | MillisToTimeval (int64_t nTimeout) |
| Convert milliseconds to a struct timeval for e.g. | |
| struct timeval | MillisToTimeval (std::chrono::milliseconds ms) |
| Convert milliseconds to a struct timeval for e.g. | |
Variables | |
| static constexpr std::array< std::string_view, 7 > | weekdays {"Thu", "Fri", "Sat", "Sun", "Mon", "Tue", "Wed"} |
| static constexpr std::array< std::string_view, 12 > | months {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} |
| static std::atomic< std::chrono::seconds > | g_mock_time {} |
| For testing. | |
| std::atomic< bool > | g_used_system_time {false} |
| static std::atomic< MockableSteadyClock::mock_time_point::duration > | g_mock_steady_time {} |
| For testing. | |
| std::string FormatISO8601Date | ( | int64_t | nTime | ) |
| std::string FormatISO8601DateTime | ( | int64_t | nTime | ) |
| std::string FormatRFC1123DateTime | ( | int64_t | time | ) |
RFC1123 formatting https://www.rfc-editor.org/rfc/rfc1123#section-5.2.14 Used in HTTP/1.1 responses.
Definition at line 124 of file time.cpp.
| std::chrono::seconds GetMockTime | ( | ) |
| int64_t GetTime | ( | ) |
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
ClockType is
Definition at line 81 of file time.cpp.
| struct timeval MillisToTimeval | ( | int64_t | nTimeout | ) |
| struct timeval MillisToTimeval | ( | std::chrono::milliseconds | ms | ) |
| std::optional< int64_t > ParseISO8601DateTime | ( | std::string_view | str | ) |
| void SetMockTime | ( | int64_t | nMockTimeIn | ) |
| void SetMockTime | ( | std::chrono::seconds | mock_time_in | ) |
| void SetMockTime | ( | std::chrono::time_point< NodeClock, std::chrono::seconds > | mock | ) |
| void UninterruptibleSleep | ( | const std::chrono::microseconds & | n | ) |
|
static |
|
static |
|
staticconstexpr |