#include <sys/time.h>
long getCurrentTime()
{
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
C++获取系统时间方法(毫秒级)
最新推荐文章于 2024-06-20 19:11:01 发布
#include <sys/time.h>
long getCurrentTime()
{
struct timeval tv;
gettimeofday(&tv,NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}