|
constexpr | Duration () noexcept=default |
| Default constructor, initializes to zero.
|
constexpr | Duration (rep nanoseconds) noexcept |
| Constructs a duration with specified nanoseconds.
|
template<typename Rep, typename Period> |
constexpr | Duration (const std::chrono::duration< Rep, Period > &duration) noexcept |
| Constructs a duration from std::chrono::duration.
|
constexpr | Duration (const Duration &) noexcept=default |
constexpr | Duration (Duration &&) noexcept=default |
constexpr Duration & | operator= (const Duration &) noexcept=default |
constexpr Duration & | operator= (Duration &&) noexcept=default |
constexpr chrono_duration | to_chrono () const noexcept |
| Converts to std::chrono::duration.
|
template<typename TargetDuration> |
constexpr TargetDuration | to () const noexcept |
| Converts to any std::chrono::duration.
|
constexpr rep | days () const noexcept |
| Gets the duration in days.
|
constexpr double | days_float () const noexcept |
| Gets the duration in days with fractional precision.
|
constexpr rep | hours () const noexcept |
| Gets the duration in hours.
|
constexpr double | hours_float () const noexcept |
| Gets the duration in hours with fractional precision.
|
constexpr rep | minutes () const noexcept |
| Gets the duration in minutes.
|
constexpr double | minutes_float () const noexcept |
| Gets the duration in minutes with fractional precision.
|
constexpr rep | seconds () const noexcept |
| Gets the duration in seconds.
|
constexpr double | seconds_float () const noexcept |
| Gets the duration in seconds with fractional precision.
|
constexpr rep | milliseconds () const noexcept |
| Gets the duration in milliseconds.
|
constexpr double | milliseconds_float () const noexcept |
| Gets the duration in milliseconds with fractional precision.
|
constexpr rep | microseconds () const noexcept |
| Gets the duration in microseconds.
|
constexpr double | microseconds_float () const noexcept |
| Gets the duration in microseconds with fractional precision.
|
constexpr rep | nanoseconds () const noexcept |
| Gets the duration in nanoseconds.
|
constexpr double | nanoseconds_float () const noexcept |
| Gets the duration in nanoseconds with double precision.
|
constexpr rep | count () const noexcept |
| Gets the total duration in nanoseconds.
|
constexpr Duration | operator+ () const noexcept |
constexpr Duration | operator- () const noexcept |
constexpr Duration & | operator+= (const Duration &other) noexcept |
constexpr Duration & | operator-= (const Duration &other) noexcept |
constexpr Duration & | operator*= (rep multiplier) noexcept |
constexpr Duration & | operator/= (rep divisor) noexcept |
constexpr Duration & | operator%= (const Duration &other) noexcept |
constexpr bool | operator== (const Duration &rhs) const noexcept |
constexpr bool | operator!= (const Duration &rhs) const noexcept |
constexpr bool | operator< (const Duration &rhs) const noexcept |
constexpr bool | operator<= (const Duration &rhs) const noexcept |
constexpr bool | operator> (const Duration &rhs) const noexcept |
constexpr bool | operator>= (const Duration &rhs) const noexcept |
Represents a duration with nanosecond precision.
Duration provides a platform-independent way to represent time durations with high precision. It supports arithmetic operations and various time unit conversions, fully interoperable with std::chrono::duration.