代码如下(当然也可以改成微秒):
#include
#include
#include
#include
long timestamp()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec*1000 + tv.tv_usec/1000);
}
代码如下(当然也可以改成微秒):
#include
#include
#include
#include
long timestamp()
{
struct timeval tv;
gettimeofday(&tv, NULL);
return (tv.tv_sec*1000 + tv.tv_usec/1000);
}
微信扫码登录