t = time (NULL);
senttime = tm.tm_min;
while (1)
{
t = time (NULL);
memcpy (&tm, localtime (&t), sizeof (struct tm));
timer = tm.tm_min - senttime;
if (timer < 0 )
{
timer = timer + 60;
}
printf("timer is %d\n",timer);
if (timer >= timezone)
{
sigalrm_fn();
senttime = tm.tm_min;
}
sleep(60);
};这段代码的含义是什么啊,谢谢啊 |