The Clock class represents a system-wide clock, best suitable for timestamping events. Typically monotonic and unaffected by the system clock adjustment, altough this is not guaranteed.
More...
#include <clock.hpp>
|
bool | is_steady = boost::chrono::steady_clock::is_steady |
|
The Clock class represents a system-wide clock, best suitable for timestamping events. Typically monotonic and unaffected by the system clock adjustment, altough this is not guaranteed.
Definition at line 85 of file clock.hpp.
The duration type of the clock.
Definition at line 90 of file clock.hpp.
The tick period of the clock in nanoseconds.
Definition at line 89 of file clock.hpp.
The representation type of the duration and time_point.
Definition at line 88 of file clock.hpp.
The time_point type of the clock. Different clocks are permitted to share a time_point definition if it is valid to compare their time_points by comparing their respective durations.
Definition at line 96 of file clock.hpp.
Enum expected argument.
Enumerator |
---|
Expect_SoonerOrLater |
Pick the nearest result to user-provided reference.
|
Expect_Later |
Result is expected to be later than user-provided reference.
|
Expect_Sooner |
Result is expected to be sooner than user-provided reference.
|
Definition at line 106 of file clock.hpp.
Get a time point from a number of milliseconds on 32 bits.
Since the 32 bits number overflows every ~50 days, an infinity of time points match a given 32 bits number (all modulo ~50 days). This function picks the result near the guess timepoint depending on the expect argument:
- if expect == LATER, result is expected to be later than guess: guess <= result < guess + period
- if expect == SOONER, result is expected to be sooner than guess: guess - period < result <= guess
- if expect == SOONER_OR_LATER, pick the nearest result: guess - period/2 < result <= guess + period/2
where period == 2^32 ms ~ 50 days
Get a time point from a number of milliseconds on 32 bits.
Since the 32 bits number overflows every ~50 days, an infinity of time points match a given 32 bits number (all modulo ~50 days). This function picks the result near the guess timepoint depending on the expect argument:
- if expect == LATER, result is expected to be later than guess: guess <= result < guess + period
- if expect == SOONER, result is expected to be sooner than guess: guess - period < result <= guess
- if expect == SOONER_OR_LATER, pick the nearest result: guess - period/2 < result <= guess + period/2
where period == 2^32 ms ~ 50 days
Returns a time_point representing the current value of the clock.
Convert the time point to a number of milliseconds on 32 bits.
Since the 32 bits number overflows every 2^32 ms ~ 50 days, this is a lossy operation.
- Parameters
-
t | The time point to convert. |
- Returns
- Integer (int) representing the time.
Convert the time point to a number of milliseconds on 32 bits.
Since the 32 bits number overflows every 2^32 ms ~ 50 days, this is a lossy operation.
- Parameters
-
t | The time point to convert. |
- Returns
- Unsigned int representing the time.
bool qi::Clock::is_steady = boost::chrono::steady_clock::is_steady |
true if t1 <= t2 is always true, else false.
- Note
- A clock that can be adjusted backwards is not steady.
Definition at line 102 of file clock.hpp.
The documentation for this class was generated from the following file:
- /home/opennao/work/release-2.8/sdk/libqi/qi/clock.hpp