5extern struct timespec libxr_linux_start_time_spec;
37 static int64_t GetElapsedMicroseconds()
39 struct timespec ts = {};
40 clock_gettime(CLOCK_MONOTONIC, &ts);
41 return static_cast<int64_t
>(ts.tv_sec - libxr_linux_start_time_spec.tv_sec) * 1000000LL +
42 static_cast<int64_t
>(ts.tv_nsec - libxr_linux_start_time_spec.tv_nsec) / 1000LL;
Linux 时间基准实现 / Linux timebase implementation.
MicrosecondTimestamp _get_microseconds()
获取当前微秒计数 / Get current timestamp in microseconds
MillisecondTimestamp _get_milliseconds()
获取当前毫秒计数 / Get current timestamp in milliseconds
表示微秒级时间戳的类。Class representing a timestamp in microseconds.
表示毫秒级时间戳的类。Class representing a timestamp in milliseconds.
时间基类,用于提供高精度时间戳。 Timebase class for providing high-precision timestamps.