您的位置:首页 > 编程语言

测试程序代码运行时间源代码

2011-01-04 09:59 387 查看
#include <time.h>

 

FILE *stream;

stream = freopen("d://1.txt","a+",stdin);

 

#ifdef TIME_TEST

 

clock_t begin,end;

double cost;

begin = clock();

/*《程序代码段》

 *filename = "D://1.bmp";

 *fprintf(stream,"string:%s/n",MDFile(filename));

 */

end = clock();

cost = (double)(end-begin)/CLOCKS_PER_SEC;

fprintf(stream,"%lf秒/n",cost*1000);

 

#endif
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  测试 stream include string