struct timeval pts;
gettimeofday(&pts,NULL);
int64_t ptsTime = (int64_t)pts.tv_sec * 1000 + (int64_t)pts.tv_usec / 1000;
std::string static inline get_time(){
//获取系统时间戳
time_t timeReal;
time(&timeReal);
timeReal = timeReal + 8*3600;
tm* t = gmtime(&timeReal);
char time[100];
snprintf(time, sizeof(time), "%d-%02d-%02d %02d:%02d:%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
std::string time_str = time ;
return time_str;
}
07-14
918
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-19
1192
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-10
2316
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)