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是系统常量,表示系统时钟滴答数。
clock()函数的头文件是time.h,基本结构如下:
clock_t start,stop; start = clock(); { 要计时区域 } stop = clock(); printf(“time is %f”,(float)(stop - start)/CLOCKS_PER_SEC);
其中CLOCKS_PER_SEC是系统常量,表示系统时钟滴答数。