69,371
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <time.h>
#include <sys/timeb.h>
#include <windows.h>
int main(void)
{
struct tm *now;
struct timeb tb;
while (1)
{
ftime(&tb);
now = localtime(&tb.time);
printf("%04d-%02d-%02d,%02d:%02d:%02d-%03d\n", now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec, tb.millitm);
Sleep(1000);
}
return 0;
}