struct itimerval timer_info;
// Makes alarm happen only once
timer_info.it_interval.tv_sec = 0;
timer_info.it_interval.tv_usec = 0;
// Sent it after s seconds
timer_info.it_value.tv_sec = 1;
timer_info.it_value.tv_usec = 0;

if (setitimer(ITIMER_PROF, &timer_info, NULL) == -1) {
    perror("setitimer");
    exit(1);
}