|
RTI Connext Traditional C++ API Version 7.7.0
|
APIs related to clock selection.
APIs related to clock selection.
RTI Connext uses clocks to measure time and generate timestamps.
RTI Connext uses three clocks, an "internal clock," an "external clock," and a "wall clock". The internal clock measures time internally. The external clock generates timestamps, such as the source timestamp and the reception timestamp, in addition to providing the current time given by the Domain Participant's API. The internal and external clocks can be configured via properties. The wall clock is not configurable and always shows the system time. It is used internally whenever a real-world time is necessary, such as for external document time verification.
Two clock implementations are generally available, the monotonic clock and the realtime clock.
The monotonic clock provides times that are monotonic from a clock that is not adjustable. This clock is useful to use in order to not be subject to changes in the system or realtime clock, which may be adjusted by the user or via time synchronization protocols. However, this time generally starts from an arbitrary point in time, such as system startup. Note that this clock is not available for all architectures. Please see the Platform Notes for the architectures on which it is supported. For the purposes of clock selection, this clock can be referenced by the name "monotonic".
The realtime clock provides the real time of the system. This clock may generally be monotonic but may not be guaranteed to be so. It is adjustable and may be subject to small and large changes in time. The time obtained from this clock is generally a meaningful time in that it is the amount of time from a known epoch. For the purposes of clock selection, this clock can be referenced by the names "realtime" or "system".
By default, the internal clock uses the monotonic clock and the external clocks uses the realtime clock. The default setup offers robustness to changes in the system time. Since the monotonic clock is not available on all platforms, by default, RTI Connext will attempt to use the monotonic clock, and will fall back to the realtime clock if the monotonic clock is not available.
If you want your application to be robust to changes in the system time, you are not relying on source timestamps, and you want to avoid obtaining times from both clocks, you may use the monotonic clock for both the internal and external clocks.
To configure the clock selection, use the PROPERTY QoS policy associated with the DDSDomainParticipant.
The following table lists the supported clock selection properties.
| Property | Description |
|---|---|
| dds.clock.external_clock | Comma-delimited list of clocks to use for the external clock, in order of preference. Valid clock names are "realtime", "system", and "monotonic". Default: "realtime" |
| dds.clock.internal_clock | Comma-delimited list of clocks to use for the internal clock, in order of preference. Valid clock names are "realtime", "system", and "monotonic". Default: "monotonic" if available, "realtime" if not |