Fork me on GitHub

最简单的代码,能够解决最棘手的问题,才是解决工程师的需要:

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

int main(void)
{
time_t t;
time(&t);
while(1)
{
    sleep(1);
    printf("Today's date and time: %s", ctime(&t));
}
return 0;
}

 

posted on 2021-01-15 18:15  虚生  阅读(452)  评论(0编辑  收藏  举报