SDL times are signed, 64-bit integers representing nanoseconds since the Unix epoch (Jan 1, 1970).
More...
|
| constexpr | Time (TimeRaw time) noexcept |
| | Wraps Time. More...
|
| |
| constexpr | Time (std::chrono::nanoseconds time) noexcept |
| | Wraps Time. More...
|
| |
|
constexpr | operator bool () const |
| | True if not zero.
|
| |
|
constexpr | operator std::chrono::nanoseconds () const |
| | Converts to nanoseconds period.
|
| |
|
constexpr Sint64 | ToNS () const |
| | Converts to nanoseconds Sint64.
|
| |
| constexpr Sint64 | ToPosix () const |
| | Convert nanoseconds to seconds. More...
|
| |
| void | ToWindows (Uint32 *dwLowDateTime, Uint32 *dwHighDateTime) const |
| | Converts an SDL time into a Windows FILETIME (100-nanosecond intervals since January 1, 1601). More...
|
| |
|
constexpr float | ToSeconds () const |
| | Converts a time to seconds (float) since epoch.
|
| |
|
constexpr Time & | operator+= (std::chrono::nanoseconds interval) |
| | Increment time.
|
| |
|
constexpr Time & | operator-= (std::chrono::nanoseconds interval) |
| | Decrement.
|
| |
|
| static Time | Current () |
| | Gets the current value of the system realtime clock in nanoseconds since Jan 1, 1970 in Universal Coordinated Time (UTC). More...
|
| |
|
static constexpr Time | FromNS (Sint64 time) |
| | Create from a nanoseconds Sint64.
|
| |
| static constexpr Time | FromPosix (Sint64 time) |
| | Convert seconds to nanoseconds. More...
|
| |
| static Time | FromWindows (Uint32 dwLowDateTime, Uint32 dwHighDateTime) |
| | Converts a Windows FILETIME (100-nanosecond intervals since January 1, 1601) to an SDL time. More...
|
| |
|
static constexpr Time | FromSeconds (float interval) |
| | Converts a time to seconds (float) since epoch.
|
| |
They can be converted between POSIX time_t values with Time.ToPosix() and Time.FromPosix(), and between Windows FILETIME values with Time.ToWindows() and Time.FromWindows().
- Since
- This type is available since SDL 3.2.0.
- See also
- MAX_SINT64
-
MIN_SINT64
◆ Time() [1/2]
| constexpr SDL::Time::Time |
( |
TimeRaw |
time | ) |
|
|
inlineexplicitconstexprnoexcept |
- Parameters
-
| time | the value to be wrapped |
◆ Time() [2/2]
| constexpr SDL::Time::Time |
( |
std::chrono::nanoseconds |
time | ) |
|
|
inlineconstexprnoexcept |
- Parameters
-
| time | the value to be wrapped |
The documentation for this class was generated from the following files: