clock()是C/C++中的计时函数,而与其相关的数据类型是clock_t; 头文件:time.h/ctime
在C/C++中,还定义了一个常量CLOCKS_PER_SEC,它用来表示一秒钟会有多少个时钟计时单元,其定义如下:
#define CLOCKS_PER_SEC ((clock_t)1000)
#include “stdio.h”
#include “stdlib.h”
#include “time.h”
int main( void )
{
long i =