C++获取毫秒级时间戳时间:2021-04-02 08:51:34#include<chrono> auto timeNow = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()); char bufTime[16]{ 0 }; sprintf(bufTime, "%lld", timeNow.count()); //bufTime 存放的就是获取到的毫秒级时间戳