c/c++获取时间戳

以毫秒为单位获取当前时间戳:
#include<chrono>
auto t1 = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
若以秒为单位,将milliseconds改为seconds

posted @ 2024-11-02 13:01  Eric13  阅读(191)  评论(0)    收藏  举报