获取当前时间戳

 

获取当前时间戳

#include <iostream>
#include <sys/time.h>

int main(){
    struct timeval tv;
    gettimeofday(&tv, NULL);
    auto count = tv.tv_sec * 1000ul + tv.tv_usec /1000;
    std::cout<<"count:"<<count<<std::endl;

    return 0;
}

 

posted @ 2024-01-12 17:07  He_LiangLiang  阅读(6)  评论(0编辑  收藏  举报