how to implement timer

anyone can help me how to implement the timer on AIX?
I tried with 'setitimer' and its related functions, but it does not work correctly,the program exited each time.
thanks

The following is my code:

#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

volatile int time_has_come;
time_t cur_time;

void handler(int signal)
{
//time_has_come = 1;
cur_time = time(NULL);
printf("!!!!!!! %s\n", ctime(&cur_time));
return;
}

struct itimerval interval;

int main(int argc, char * const argv[])
{
//interval.it_interval.tv_sec = 0;
interval.it_interval.tv_sec = 1;
interval.it_interval.tv_usec = 0;
interval.it_value.tv_sec = 10;
interval.it_value.tv_usec = 0;
signal(SIGVTALRM, handler);
(void) setitimer(ITIMER_VIRTUAL, &interval, NULL);
time_has_come = 0;
cur_time = time(NULL);
printf("start time =%s\n", ctime(&cur_time));
while (1) {
if (time_has_come) {
cur_time = time(NULL);
printf("time_has_come = %d exit time = %s!\n", time_has_come, ctime(&cur_time));
exit(0);
}

}
}

The above timer is active just only once and the program exit, the message " Virtual timer expired" returned.

It has the same result if we use SIGALRM signal.

Thanks Driver, I will try it.