表示微秒级时间戳的类。Class representing a timestamp in microseconds.
More...
#include <libxr_time.hpp>
|
class | TimeDiffUS |
| 表示微秒级时间差的类。Class representing a time difference in microseconds. More...
|
|
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
Definition at line 18 of file libxr_time.hpp.
◆ TimestampUS() [1/2]
LibXR::TimestampUS::TimestampUS |
( |
| ) |
|
|
inline |
默认构造函数,初始化时间戳为 0。 Default constructor initializing the timestamp to 0.
Definition at line 25 of file libxr_time.hpp.
uint64_t microsecond_
以微秒存储的时间戳。Timestamp stored in microseconds.
◆ TimestampUS() [2/2]
LibXR::TimestampUS::TimestampUS |
( |
uint64_t |
microsecond | ) |
|
|
inline |
以给定的微秒值构造时间戳。 Constructor initializing the timestamp with a given microsecond value.
- Parameters
-
microsecond | 以微秒表示的时间值。Time value in microseconds. |
Definition at line 32 of file libxr_time.hpp.
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值
◆ operator uint64_t()
LibXR::TimestampUS::operator uint64_t |
( |
| ) |
const |
|
inline |
转换运算符,将时间戳转换为 uint64_t。 Conversion operator to uint64_t.
Definition at line 38 of file libxr_time.hpp.
◆ operator-()
计算两个时间戳之间的时间差。 Computes the time difference between two timestamps.
- Parameters
-
old_microsecond | 旧的时间戳。The older timestamp. |
- Returns
- TimeDiffUS 计算得到的时间差。Computed time difference.
Definition at line 94 of file libxr_time.hpp.
95 {
97
99 {
101 }
102 else
103 {
105 }
106
107 ASSERT(
diff <= libxr_timebase_max_valid_us);
108
109 return TimeDiffUS(
diff);
110 }
◆ operator=()
赋值运算符重载。 Assignment operator overload.
- Parameters
-
- Returns
- 返回当前对象的引用。Returns a reference to the current object.
Definition at line 118 of file libxr_time.hpp.
119 {
121 {
123 }
124 return *this;
125 }
◆ microsecond_
uint64_t LibXR::TimestampUS::microsecond_ |
|
private |
以微秒存储的时间戳。Timestamp stored in microseconds.
Definition at line 128 of file libxr_time.hpp.
The documentation for this class was generated from the following file: