#include <chrono>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
Go to the source code of this file.
|
| struct | NodeClock |
| | Mockable clock in the context of tests, otherwise the system clock. More...
|
| |
| struct | MockableSteadyClock |
| | Version of SteadyClock that is mockable in the context of tests (set the current value with SetMockTime), otherwise the system steady clock. More...
|
| |
◆ HoursDouble
◆ MillisecondsDouble
◆ NodeSeconds
◆ SecondsDouble
◆ SteadyClock
◆ SteadyMicroseconds
◆ SteadyMilliseconds
◆ SteadySeconds
◆ SystemClock
◆ count_microseconds()
◆ count_milliseconds()
◆ count_seconds()
◆ 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 83 of file time.cpp.
◆ FormatRFC1123DateTime()
| std::string FormatRFC1123DateTime |
( |
int64_t | nTime | ) |
|
◆ GetMockTime()
For testing.
Definition at line 52 of file time.cpp.
◆ GetTime() [1/2]
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
ClockType is
- SteadyClock/std::chrono::steady_clock for steady time
- SystemClock/std::chrono::system_clock for system time
- NodeClock for mockable system time
Definition at line 81 of file time.cpp.
◆ GetTime() [2/2]
DEPRECATED, see GetTime.
Definition at line 132 of file time.h.
◆ MillisToTimeval() [1/2]
Convert milliseconds to a struct timeval for e.g.
select.
Definition at line 142 of file time.cpp.
◆ MillisToTimeval() [2/2]
Convert milliseconds to a struct timeval for e.g.
select.
Definition at line 150 of file time.cpp.
◆ Now()
Return the current time point cast to the given precision.
Only use this when an exact precision is needed, otherwise use T::clock::now() directly.
Definition at line 126 of file time.h.
◆ ParseISO8601DateTime()
◆ SetMockTime() [1/3]
DEPRECATED Use SetMockTime with chrono type.
- Parameters
-
| [in] | nMockTimeIn | Time in seconds. |
Definition at line 44 of file time.cpp.
◆ SetMockTime() [2/3]
For testing.
Set e.g. with the setmocktime rpc, or -mocktime argument
Definition at line 46 of file time.cpp.
◆ SetMockTime() [3/3]
◆ Ticks()
template<typename Dur1 , typename Dur2 >
| constexpr auto Ticks |
( |
Dur2 | d | ) |
|
|
constexpr |
Helper to count the seconds of a duration/time_point.
All durations/time_points should be using std::chrono and calling this should generally be avoided in code. Though, it is still preferred to an inline t.count() to protect against a reliance on the exact type of t.
This helper is used to convert durations/time_points before passing them over an interface that doesn't support std::chrono (e.g. RPC, debug log, or the GUI)
Definition at line 73 of file time.h.
◆ TicksSeconds()
◆ TicksSinceEpoch()
◆ UninterruptibleSleep()