【发布时间】:2016-01-12 19:29:29
【问题描述】:
我想获取自特定时期以来的当前时间(以毫秒为单位),例如2016 年 1 月 1 日。
这样做的原因是避免为 std::chrono::milliseconds 使用 8 个字节。
我想将结果存储为 4byte 数据类型。
std::chrono::steady_clock() 使用未指定的默认纪元。
【问题讨论】:
-
我建议你为此创建自己的时钟类,它从
nowatime_point<clock, duration<int16_t, std::milli>>返回