表示微秒级时间戳的类。Class representing a timestamp in microseconds.
More...
#include <libxr_time.hpp>
|
class | TimeDiffUS |
| 表示微秒级时间差的类。Class representing a time difference in microseconds. More...
|
|
|
| TimestampUS () |
| 默认构造函数,初始化时间戳为 0。 Default constructor initializing the timestamp to 0.
|
|
| TimestampUS (uint64_t microsecond) |
| 以给定的微秒值构造时间戳。 Constructor initializing the timestamp with a given microsecond value.
|
|
| operator uint64_t () const |
| 转换运算符,将时间戳转换为 uint64_t。 Conversion operator to uint64_t.
|
|
TimeDiffUS | operator- (const TimestampUS &old_microsecond) const |
| 计算两个时间戳之间的时间差。 Computes the time difference between two timestamps.
|
|
TimestampUS & | operator= (const TimestampUS &other) |
| 赋值运算符重载。 Assignment operator overload.
|
|
|
uint64_t | microsecond_ |
| 以微秒存储的时间戳。Timestamp stored in microseconds.
|
|
表示微秒级时间戳的类。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.
◆ 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 100 of file libxr_time.hpp.
101 {
102 uint64_t diff;
103
105 {
107 }
108 else
109 {
110 diff =
microsecond_ + (libxr_timebase_max_valid_us - old_microsecond.microsecond_);
111 }
112
113 ASSERT(diff <= libxr_timebase_max_valid_us);
114
115 return TimeDiffUS(diff);
116 }
◆ operator=()
赋值运算符重载。 Assignment operator overload.
- Parameters
-
- Returns
- 返回当前对象的引用。Returns a reference to the current object.
Definition at line 124 of file libxr_time.hpp.
125 {
126 if (this != &other)
127 {
129 }
130 return *this;
131 }
◆ microsecond_
uint64_t LibXR::TimestampUS::microsecond_ |
|
private |
以微秒存储的时间戳。Timestamp stored in microseconds.
Definition at line 134 of file libxr_time.hpp.
The documentation for this class was generated from the following file: