The class TimeBase is a pseudo-clock. The class TimeBase is a pseudo-clock that is used as the first template argument to std::chrono::time_point to indicate that the time point represents local time with respect of a not-yet-specified timeBaseResource.
Serves as a pseudo-clock for std::chrono::time_point to map local points in time of a time base resource.
AI-GENERATEDunreviewedModel: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f515350f98f7ProvenanceOpen questions (3)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original
Serves as a pseudo-clock for std::chrono::time_point to map local points in time of a time base resource.
The class ara::tsync::TimeBase acts as a pseudo-clock in the C++ standard library system and serves as a clock template argument for std::chrono::time_point to represent local times with respect to a time base resource [SWS_TS_01264]. To fulfill the clock requirements, it provides standardized type aliases for nanosecond resolution and duration. As a key constraint, the clock is specified via is_steady = false as non-steady, which accounts for time jumps resulting from synchronization operations [SWS_TS_01265].
Context
The class or struct ara::tsync::TimeBase assumes the role of a pseudo-clock in the tsync module of the AUTOSAR Adaptive Platform. At C++ level, it primarily serves as the first template argument for std::chrono::time_point in order to semantically specify that a timestamp represents the local time relative to a not yet closer specified time base resource (timeBaseResource) [SWS_TS_01264]. Instead of acting as an active time source with a static time query itself, TimeBase functions as a formal link within the standard library std::chrono.
By providing the standardized type definitions, TimeBase binds the generic mechanisms of C++ time measurement to the synchronization module. Consumers and components that work with points in time or time spans use the structure's alias types to exchange typed timestamps. In this way, it is guaranteed that time values via std::chrono::time_point are unambiguously assigned to a local time base and are not mistakenly mixed with absolute system clocks or differing time sources.
Context diagram: Embedding of TimeBase as a pseudo-clock into the C++ Chrono type system for binding points in time to a time base resource. Sources: [SWS_TS_01263], [SWS_TS_01264]
Lifecycle
As a pure data and type structure (declared as struct TimeBase in header ara/tsync/timestamp.h), ara::tsync::TimeBase has no dynamic lifecycle phases in the sense of an initialized or operated runtime component. Instantiation of objects of this structure is not strictly necessary for the intended function; it exists primarily at the level of the C++ type system at compile time.
To fulfill the formal C++ clock requirements, TimeBase defines all required type aliases and constants. This includes the fundamental counter type rep as std::int64_t to represent the number of time ticks [SWS_TS_01261] as well as the time tick interval period as std::nano[SWS_TS_01262], which corresponds to a resolution in the nanosecond range. The duration for measuring time since an epoch is provided via the type alias duration as std::chrono::duration<rep, period>[SWS_TS_01263].
With regard to concurrency and behavior in the running system, the structure declares the static constant is_steady with the boolean value false[SWS_TS_01265]. This signals to the C++ Chrono framework that the underlying clock is not steady (monotonic). Interpretation: This is likely attributable to the fact that time synchronization operations in module tsync can cause adjustments or jumps in the local time base, which is why consecutive measurements do not guarantee strict monotonicity. Question Q-93a56c0eb2d35c7b (open) Since the structure itself encapsulates no mutable state, all type usages and accesses to constants are inherently concurrency-safe.
Usage Path
The typical usage path of ara::tsync::TimeBase lies in declaring, processing, and passing time values within synchronized applications. Developers and adaptive software components do not instantiate the clock itself, but access the central type alias time_point, which is defined as std::chrono::time_point<TimeBase>[SWS_TS_01264].
Type definition and interface specification: The application includes the header ara/tsync/timestamp.h and uses ara::tsync::TimeBase::time_point[SWS_TS_01264] to declare signatures for timestamps. Interpretation: This ensures that points in time remain semantically coupled to the specific local time base. Question Q-549e2d377c0a6845 (open)
Arithmetic and difference calculation: If two points in time are subtracted from each other, the expression automatically yields the type ara::tsync::TimeBase::duration[SWS_TS_01263]. This is based on nanosecond steps (period) [SWS_TS_01262] and 64-bit integers (rep) [SWS_TS_01261], enabling standard-compliant duration calculations and conversions into other time units.
Interoperability with standard algorithms: Due to full fulfillment of the clock type requirements, points in time and time spans can be seamlessly passed to standard library functions of std::chrono without having to use proprietary time structures.
Interpretation: Since TimeBase is designed as a pseudo-clock, it does not provide a static member function now() itself; the concrete time value determination for such a time_point[SWS_TS_01264] is likely performed by other services or interfaces of module tsync that are connected to the referenced timeBaseResource. Question Q-2a528a99023dad41 (open)
This guide is based on the AUTOSAR Adaptive Platform R25-11 specification.
gemini-3.8-flash-low· 2026-10-13 · German original