如果定义一个时间变量 ?
[CODE]
#include <stdio.h>
#include <time.h>
#include <windows.h>
void main()
{
time_t t1;
time(&t1);
Sleep(1000);
time_t t2;
time(&t2);
if (t2 > t1)
{
printf("t2 > t1\n");
}
else
{
printf("t2 <= t1\n");
}
printf("the t1 is %s\n", ctime(&t1));
printf("the t2 is %s\n", ctime(&t2));
}
[/CODE]
[此贴子已经被作者于2006-6-19 11:01:04编辑过]