Skip to main content

Module time

Module time 

Source
Expand description

Time_t und Duration_t (DDS-DCPS 1.4 §2.3.3 IDL-PSM).

Spec definiert:

  • struct Time_t { long sec; unsigned long nanosec; }
  • struct Duration_t { long sec; unsigned long nanosec; }
  • Reservierte Sentinels: TIME_INVALID, TIME_INFINITE, DURATION_ZERO, DURATION_INFINITE.

Wire-Form ist 8 Byte (4 sec + 4 nanosec). Wir kapseln das hier mit einer Rust-API, die mit core::time::Duration und std::time::SystemTime koexistiert. Der RTPS-Wire-Layer hat eigenes Duration in zerodds_rtps::participant_data::Duration — wir konvertieren bei Bedarf.

Structs§

Duration
Duration_t — relativer Zeitraum (kann negativ sein bei sec < 0).
Time
Time_t — Wall-Clock-Timestamp seit Unix-Epoch.

Functions§

get_current_time
Aktuelle Wall-Clock-Zeit als Time. Auf std-Plattformen via std::time::SystemTime. Auf no_std (kein std-Feature) liefert die Funktion Time::INVALID — Caller muss sich um die Quelle selbst kuemmern (z.B. monotonic Hardware-Clock).