1.如果想注释掉某几行代码,可以如下操作:
#if 0
自己写的计时
clock_t start;
clock_t end;
start = clock();
cv::Mat localimg = GetFeatureMap(ipm_image, outliers);
end = clock();
double time_duration= (double)(end-start)/CLOCKS_PER_SEC;
//printf("Time is:\n");
printf("\n");
std::cout<<"The Function GetFeatureMap's TIME:"<<time_duration*1000<<"ms"<<std::endl;
#else
double start = (double)getTickCount();
//printf("start:%d ms\n",int(start*1000));
cv::Mat localimg = GetFeatureMap(ipm_image, outliers);
double end = (double)getTickCount();
//printf("end:%d ms\n",int(end*1000));
printf("'Time is:%f\n",((end-start)*1000/getTickFrequency()));
#endif