C++获取linux时间戳
#include <iostream>
#include <sys/time.h>
int64_t gettimeofday_us() {
timeval now;
gettimeofday(&now, NULL);
return now.tv_sec * 1000000L + now.tv_usec;
}
int main(void) {
int64_t start = gettimeofday_us();
}
C++获取linux时间戳
#include <iostream>
#include <sys/time.h>
int64_t gettimeofday_us() {
timeval now;
gettimeofday(&now, NULL);
return now.tv_sec * 1000000L + now.tv_usec;
}
int main(void) {
int64_t start = gettimeofday_us();
}