blob: b56e5602325f2be48e5ad697a9da27a6ebf5b3ff [file] [log] [blame]
#define _GNU_SOURCE
#include <sys/time.h>
#include <unistd.h>
unsigned ualarm(unsigned value, unsigned interval) {
struct itimerval it = {.it_interval.tv_usec = interval, .it_value.tv_usec = value};
setitimer(ITIMER_REAL, &it, &it);
return it.it_value.tv_sec * 1000000 + it.it_value.tv_usec;
}