clock()函数小计

        clock()函数的头文件是time.h,基本结构如下:

clock_t  start,stop;
start = clock();
{
要计时区域
}

stop = clock();
printf(“time is %f”,(float)(stop - start)/CLOCKS_PER_SEC);

其中CLOCKS_PER_SEC是系统常量,表示系统时钟滴答数。

posted @ 2013-04-03 17:13  孤独的小马哥  阅读(173)  评论(0)    收藏  举报