#pragma once
// 时间工具 — 统一单调时钟访问(所有模块共用, 禁止各自重复实现)
#include <chrono>
#include <cstdint>

namespace hwtime {

// 单调毫秒(程序内计时)
inline double now_ms() {
    using namespace std::chrono;
    return duration<double, std::milli>(steady_clock::now().time_since_epoch()).count();
}

// 单调微秒(帧时间戳/高精度计时)
inline uint64_t now_us() {
    using namespace std::chrono;
    return (uint64_t)duration_cast<microseconds>(steady_clock::now().time_since_epoch()).count();
}

}  // namespace hwtime
