/********************************* * FileName:debug.h * Author:coder4101 * Last Update:2014/1/27 9:50 * 备注:自己写的模板,欢迎大家提各种意见和建议。 随着知识的日积月累,我也会慢慢丰富模板内容和提高代码质量。 *******************************/ #include <ctime> #include <cstdlib> /* 第一章 计时方法 */ // 1.1 使用下列模板能模拟 Matlab中tic,toc 的效果 clock_t start__; #define tic start__=clock() #define toc cout<<(clock()-start__)*1000/CLOCKS_PER_SEC<<"ms\n" /* 第二章 调试方法 */ #define pause system("pause") //代码中可以用OK的输出来查看某点是否能顺利运行到,同时加入参数i,区分不同的OK标记 #define OK(i) printf("OK%d\n",i)