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
",(end-start)/(double)CLK_TCK);
12     return 0;
13 }
原文地址:https://www.cnblogs.com/ahaoboy/p/5711438.html