#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<windows.h>
int main()
{int i;
time_t start,end;start=clock();//用clock(),它可以精确到毫秒的
for(i=0;i<30000;i++)
printf(".");
Sleep(30); //调试的时候发现好像要大于10才能输出时间
end=clock();
printf("程序运行时间为:%lfs\n",double(end-start)/CLOCKS_PER_SEC);
//CLOCKS_PER_SEC在time.h中定义,为1000,为毫秒换算成秒的基
system("pause");
return 0;
}