timer class in linux

后端 未结 5 1585
清歌不尽
清歌不尽 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

    Use the boost::asio library. It has both synchronous and asynchronous timers which call a callback.

    http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/tutorial.html

提交回复
热议问题