C語言基礎:延遲執行的代碼

下邊代碼段是關於C語言基礎:延遲執行的代碼,希望能對大家也有用。

#include <stdio.h>
#include <time.h>

int main (void)
{
time_t current_time;
time_t start_time;

printf("About to delay 5 secondsn");

do {
  time(&current_time);
} while ((current_time - start_time) < 5);

printf("Donen");

return 1;

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章