題目:時間函式舉例2
程式分析:無,
程式源代碼:
1 #include <stdio.h> 2 #include <time.h> 3 4 int main() 5 { 6 time_t start,end; 7 int i; 8 start=time(NULL); 9 for(i=0;i<300000;i++) 10 { 11 printf("\n"); // 回傳兩個time_t型變數之間的時間間隔 12 } 13 end=time(NULL); 14 15 // 輸出執行時間 16 printf("時間間隔為 %6.3f\n",difftime(end,start)); 17 }
以上實體運行輸出結果為:
時間間隔為 1.000
感謝你的閱讀,請用心感悟!希望可以幫到愛學習的你!!分享也是一種快樂!!!請接力,,,
點擊查看原文,謝謝!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/1869.html
標籤:C
上一篇:C 實戰練習題目91
下一篇:C 實戰練習題目93
