且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Linux中使用C ++创建计时器队列

更新时间:2023-11-17 16:05:28

您是否可以使用 libevent 进行此操作?


I have implemented a project in Windows using C++ that creates a timer queue, add entries to it, perform a callback function when the timer expires,waits for next timer, etc. It was possible using the Windows functions CreateTimer, CreateTimerQueueTimer, CreateTimer,etc.

Now my question is how to do the same thing in Linux using C++? Is there some API ? Is timer_create a good option for doing this? It will be much helpful if an example is also provided.

Thankyou.

Can't you use libevent for this ?