#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <time.h>
#include <windows.h>
int main(int argc, char** argv)
{
while(1)
{
time_t timep;
time (&timep);
FILE *fp = fopen("c:\\log.txt","a");
if( !fp )
{
printf("The file can not open.\n");
return 0;
}
Sleep(3000);
char *pTime_log = ctime(&timep);
fputs(pTime_log, fp);
fclose(fp);
}
return 0;
}