a*****r 发帖数: 443 | 1 I am programming in C where need a timer to make sure the program will use t
he function periodically.
My present idea is only to use a loop to get time() and calculate, but it lo
oks like very stupid.
My question is how to set the timer in a smart way.
Thanks for your help very much. | c*r 发帖数: 278 | 2 interval timer and SIGALRM.
use alarm() or setitimer().
set proper handler for SIGALRM
【在 a*****r 的大作中提到】 : I am programming in C where need a timer to make sure the program will use t : he function periodically. : My present idea is only to use a loop to get time() and calculate, but it lo : oks like very stupid. : My question is how to set the timer in a smart way. : Thanks for your help very much.
|
|