5#include "libxr_assert.hpp"
6#include "libxr_def.hpp"
8static inline uint64_t libxr_timebase_max_valid_us = UINT64_MAX;
9static inline uint32_t libxr_timebase_max_valid_ms = UINT32_MAX;
107 ASSERT(
diff <= libxr_timebase_max_valid_us);
209 ASSERT(
diff <= libxr_timebase_max_valid_ms);
表示毫秒级时间差的类。Class representing a time difference in milliseconds.
double to_second()
以秒返回时间差(double 类型)。 Returns the time difference in seconds as a double.
uint32_t to_millisecond() const
以毫秒返回时间差。 Returns the time difference in milliseconds.
uint32_t diff_
存储时间差(毫秒)。Time difference stored in milliseconds.
uint64_t to_microsecond() const
以微秒返回时间差。 Returns the time difference in microseconds.
TimeDiffMS(uint32_t diff)
构造函数,初始化时间差。 Constructor initializing the time difference.
float to_secondf()
以秒返回时间差(float 类型)。 Returns the time difference in seconds as a float.
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds.
uint32_t millisecond_
以毫秒存储的时间戳。Timestamp stored in milliseconds.
TimeDiffMS operator-(TimestampMS &old_millisecond)
计算两个时间戳之间的时间差。 Computes the time difference between two timestamps.
表示微秒级时间差的类。Class representing a time difference in microseconds.
float to_secondf() const
以秒返回时间差(float 类型)。 Returns the time difference in seconds as a float.
uint32_t to_millisecond() const
以毫秒返回时间差。 Returns the time difference in milliseconds.
TimeDiffUS(uint64_t diff)
构造函数,初始化时间差。 Constructor initializing the time difference.
double to_second() const
以秒返回时间差(double 类型)。 Returns the time difference in seconds as a double.
uint64_t diff_
存储时间差(微秒)。Time difference stored in microseconds.
uint64_t to_microsecond() const
以微秒返回时间差。 Returns the time difference in microseconds.
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
TimeDiffUS operator-(const TimestampUS &old_microsecond) const
计算两个时间戳之间的时间差。 Computes the time difference between two timestamps.
TimestampUS()
默认构造函数,初始化时间戳为 0。 Default constructor initializing the timestamp to 0.
TimestampUS(uint64_t microsecond)
以给定的微秒值构造时间戳。 Constructor initializing the timestamp with a given microsecond value.
uint64_t microsecond_
以微秒存储的时间戳。Timestamp stored in microseconds.
TimestampUS & operator=(const TimestampUS &other)
赋值运算符重载。 Assignment operator overload.
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值