timer class in linux

后端 未结 5 1598
清歌不尽
清歌不尽 2021-02-04 22:27

I need a timer to execute callbacks with relatively low resolution. What\'s the best way to implement such C++ timer class in Linux? Are there any libraries I could use?

5条回答
  •  天涯浪人
    2021-02-04 22:59

    here is a link for a timer class. u will only need to create timer and pass it value for auto reload or not. a pointer to call back function. and either if u want it to be handled by a thread or with signal. if u choose signal then u have to pass the signo also.

    http://timerlinux.codeplex.com/

    If u want to study more about timer or signals there is a good book called linux system programming. u will only have to read 3 chapters and its explaining it all.

提交回复
热议问题