Calc Time on Linux

来源:互联网 发布:云计算第三版课后答案 编辑:程序博客网 时间:2024/04/30 03:41
#include <sys/time.h>struct timeval t1;gettimeofday(&t1, NULL);//some code herestruct 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
1 0
原创粉丝点击