TimeStamp class
#include <nCine/Base/TimeStamp.h>
Wraps a clock counter value representing a point in time or a duration.
Stores a raw counter value obtained from the system Clock. The same type is used both for absolute time points (e.g., now()) and for durations (e.g. the result of subtracting two time stamps). Conversion methods are provided to read the stored value, or the time elapsed since it, in seconds, milliseconds, microseconds or nanoseconds.
Public static functions
- static auto Now() -> TimeStamp
- Returns a new time stamp initialized to the current clock value.
Constructors, destructors, conversion operators
Public functions
- auto operator>(const TimeStamp& other) const -> bool
- auto operator<(const TimeStamp& other) const -> bool
- auto operator+=(const TimeStamp& other) -> TimeStamp&
- auto operator-=(const TimeStamp& other) -> TimeStamp&
- auto operator+(const TimeStamp& other) const -> TimeStamp
- auto operator-(const TimeStamp& other) const -> TimeStamp
- auto GetTimeSince() const -> TimeStamp
- Returns a new time stamp holding the duration elapsed since this one.
- auto GetSecondsSince() const -> float
- Returns the time elapsed since this time stamp, in seconds.
- auto GetMillisecondsSince() const -> float
- Returns the time elapsed since this time stamp, in milliseconds.
- auto GetMicrosecondsSince() const -> float
- Returns the time elapsed since this time stamp, in microseconds.
- auto GetNanosecondsSince() const -> float
- Returns the time elapsed since this time stamp, in nanoseconds.
-
auto GetTicks() const -> std::
uint64_t - Returns the raw counter value in ticks.
- auto GetSeconds() const -> float
- Returns the stored counter value as seconds.
- auto GetMilliseconds() const -> float
- Returns the stored counter value as milliseconds.
- auto GetMicroseconds() const -> float
- Returns the stored counter value as microseconds.
- auto GetNanoseconds() const -> float
- Returns the stored counter value as nanoseconds.