Absolute time as realtime or monotonically increasing clock.
More...
#include <Time.h>
Absolute time as realtime or monotonically increasing clock.
- See also
- Monotonic
-
Realtime
◆ Absolute() [1/2]
SC::Time::Absolute::Absolute |
( |
| ) |
|
|
inline |
Construct an Absolute time equal to epoch.
◆ Absolute() [2/2]
SC::Time::Absolute::Absolute |
( |
int64_t |
milliseconds | ) |
|
|
inline |
Construct an Absolute from milliseconds since epoch.
- Parameters
-
milliseconds | Number of milliseconds since epoch |
◆ isLaterThan()
bool SC::Time::Absolute::isLaterThan |
( |
Absolute |
other | ) |
const |
Check if this Absolute time is lather than another Absolute time.
- Note
- Comparing Absolute times obtained with different clock sources (monotonic/realtime) is meaningless
◆ isLaterThanOrEqualTo()
bool SC::Time::Absolute::isLaterThanOrEqualTo |
( |
Absolute |
other | ) |
const |
Check if this Absolute time is later or equal to another Absolute time.
- Note
- Comparing Absolute times obtained with different clock sources (monotonic/realtime) is meaningless
◆ offsetBy()
Offset this absolute time with a relative time in milliseconds.
◆ parseLocal()
bool SC::Time::Absolute::parseLocal |
( |
ParseResult & |
result | ) |
const |
Parses local time to a Parsed structure.
- Parameters
-
[out] | result | The Parsed structure holding current date / time |
- Returns
true
if time has been parsed successfully
Example: Time::Absolute::ParseResult local;
report.console.print("{} {:02}/{:02}/{} {:02}:{:02}:{:02} {}", local.getDay(), local.dayOfMonth, local.getMonth(),
local.year, local.hour, local.minutes, local.seconds,
local.isDaylightSaving ? "DAYLIGHT SAVING" : "NO DAYLIGHT SAVING");
#define SC_TEST_EXPECT(e)
Records a test expectation (eventually aborting or breaking o n failed test)
Definition: Testing.h:113
bool parseLocal(ParseResult &result) const
Parses local time to a Parsed structure.
static Realtime now()
Obtain time according to realtime clock.
◆ parseUTC()
bool SC::Time::Absolute::parseUTC |
( |
ParseResult & |
result | ) |
const |
Parses UTC time to a Parsed structure.
- Parameters
-
[out] | result | The Parsed structure holding current date / time |
- Returns
true
if time has been parsed successfully
◆ subtractExact()
Obtains the difference between this time and the other time.
- Note
- Subtracting Absolute times obtained with different clock sources (monotonic/realtime) is meaningless
The documentation for this struct was generated from the following file: