3#include "libxr_time.hpp"
97 Detail::ConfigureTimebaseWrapRange(max_valid_us, max_valid_ms);
106 return Detail::TimebaseMaxValidUs();
115 return Detail::TimebaseMaxValidMs();
微秒时间戳 / Microsecond timestamp
毫秒时间戳 / Millisecond timestamp
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.
static bool ready_
时间基是否已完成初始化。 Whether the timebase backend has been initialized.
Timebase()=default
默认构造函数。 Default constructor.
static void ConfigureWrapRange(uint64_t max_valid_us, uint32_t max_valid_ms) noexcept
配置时间戳回绕上界。 Configure the timestamp wraparound limits.
Timebase(const Timebase &)=delete
禁止拷贝构造。 Copy construction is disabled.
Timebase & operator=(const Timebase &)=delete
禁止拷贝赋值。 Copy assignment is disabled.
static bool IsReady() noexcept
检查时间基是否已经初始化。 Check whether the active timebase backend is initialized.
static uint32_t GetConfiguredWrapRangeMs() noexcept
读取当前配置的毫秒回绕上界。 Read the configured millisecond wraparound limit.
static uint64_t GetConfiguredWrapRangeUs() noexcept
读取当前配置的微秒回绕上界。 Read the configured microsecond wraparound limit.
static void SetReady(bool ready=true) noexcept
设置时间基就绪状态。 Set the timebase ready flag.
static MicrosecondTimestamp GetMicroseconds()
获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds.
static MillisecondTimestamp GetMilliseconds()
获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds.
static void DelayMicroseconds(uint32_t us)
微秒级延时 / Delay in microseconds