source:
azure_iot_hub/trunk/musl-1.1.18/src/unistd/ualarm.c
Last change on this file was 389, checked in by , 5 years ago | |
---|---|
|
|
File size: 303 bytes |
Line | |
---|---|
1 | #define _GNU_SOURCE |
2 | #include <unistd.h> |
3 | #include <sys/time.h> |
4 | |
5 | unsigned ualarm(unsigned value, unsigned interval) |
6 | { |
7 | struct itimerval it = { |
8 | .it_interval.tv_usec = interval, |
9 | .it_value.tv_usec = value |
10 | }; |
11 | setitimer(ITIMER_REAL, &it, &it); |
12 | return it.it_value.tv_sec*1000000 + it.it_value.tv_usec; |
13 | } |
Note:
See TracBrowser
for help on using the repository browser.