c语言计算程序运行时间
1 #include <stdio.h> 2 #include <time.h> 3 #include <windows.h> 4 int main(int argc, char *argv[]) 5 { 6 clock_t start,end; 7 start=clock(); 8 Sleep(1000); 9 end=clock(); 10 11 printf("time is %lf\n",(end-start)/(double)CLK_TCK); 12 return 0; 13 }