Class SteadyTimestamp
Defined in File timestamp.h
Class Documentation
-
class SteadyTimestamp
A timepoint relative to the monotonic clock epoch.
This is used for calculating the duration of an operation.
Public Functions
-
inline SteadyTimestamp() noexcept
Initializes a monotonic timestamp pointing to the start of the epoch.
-
template<class Rep, class Period>
inline explicit SteadyTimestamp(const std::chrono::duration<Rep, Period> &time_since_epoch) noexcept Initializes a monotonic timestamp from a duration.
- Parameters:
time_since_epoch – Time elapsed since the beginning of the epoch.
-
inline SteadyTimestamp(const std::chrono::steady_clock::time_point &time_point) noexcept
Initializes a monotonic timestamp based on a point in time.
- Parameters:
time_point – A point in time.
-
inline operator std::chrono::steady_clock::time_point() const noexcept
Returns a time point for the time stamp.
- Returns:
A time point corresponding to the time stamp.
-
inline std::chrono::nanoseconds time_since_epoch() const noexcept
Returns the nanoseconds since the beginning of the epoch.
- Returns:
Elapsed nanoseconds since the beginning of the epoch for this timestamp.
-
inline bool operator==(const SteadyTimestamp &other) const noexcept
Compare two steady time stamps.
- Returns:
true if the two time stamps are equal.
-
inline bool operator!=(const SteadyTimestamp &other) const noexcept
Compare two steady time stamps for inequality.
- Returns:
true if the two time stamps are not equal.
-
inline SteadyTimestamp() noexcept