libxr 1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
timebase.hpp
1#pragma once
2
3#include "libxr_time.hpp"
4
5namespace LibXR
6{
7
18{
19 public:
31 {
32 libxr_timebase_max_valid_ms = max_valid_ms;
33 libxr_timebase_max_valid_us = max_valid_us;
34 timebase = this;
35 }
36
50
64
77 virtual TimestampUS _get_microseconds() = 0; // NOLINT
78
91 virtual TimestampMS _get_milliseconds() = 0; // NOLINT
92
101 static inline Timebase *timebase = nullptr; // NOLINT
102};
103
104} // namespace LibXR
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.
Definition timebase.hpp:18
static Timebase * timebase
静态指针,用于存储全局时间基对象。 Static pointer storing the global timebase instance.
Definition timebase.hpp:101
Timebase(uint64_t max_valid_us=UINT64_MAX, uint32_t max_valid_ms=UINT32_MAX)
默认构造函数,初始化全局时间基指针。 Default constructor, initializing the global timebase pointer.
Definition timebase.hpp:30
static TimestampUS GetMicroseconds()
获取当前时间的微秒级时间戳。 Gets the current timestamp in microseconds.
Definition timebase.hpp:49
virtual TimestampMS _get_milliseconds()=0
纯虚函数,获取当前时间的毫秒级时间戳(由派生类实现)。 Pure virtual function for obtaining the current timestamp in milliseconds...
static TimestampMS GetMilliseconds()
获取当前时间的毫秒级时间戳。 Gets the current timestamp in milliseconds.
Definition timebase.hpp:63
virtual TimestampUS _get_microseconds()=0
纯虚函数,获取当前时间的微秒级时间戳(由派生类实现)。 Pure virtual function for obtaining the current timestamp in microseconds...
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds.
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
LibXR Color Control Library / LibXR终端颜色控制库
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值