#include <sys/time.h>
struct timeval t1;gettimeofday(&t1, NULL);
//some code here
struct timeval t2;gettimeofday(&t2, NULL);
long int time_interval = (t2.tv_sec-t1.tv_sec)*1000000 + t2.tv_usec-t1.tv_usec;
cout << "t1: " << time_interval
Calc Time on Linux
最新推荐文章于 2024-11-29 14:30:11 发布
