#include
#include
#include
#include
#include
#include
main(int argc,char * args[]){
long start_sec,end_sec,start_usec,end_usec;
struct timeval tv;
double duration;
gettimeofday(&tv,NULL);
start_sec=tv.tv_sec;
start_usec=tv.tv_usec;
YOUR_PROGRAM();
gettimeofday(&tv,NULL);
end_sec=tv.tv_sec;
end_usec=tv.tv_usec;
duration =(double)(end_usec-start_usec)/1000+(end_sec-start_sec)*1000;
printf("Runtime :%.2f ms\n",duration);
}
阅读(2098) | 评论(0) | 转发(0) |