在Linux中使用C ++创建计时器队列 [英] Create timer queue in Linux using C++

查看:143
本文介绍了在Linux中使用C ++创建计时器队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 中使用 C ++ 实现了一个项目,创建一个计时器队列,一个回调函数,当定时器到期,等待下一个定时器等。可能使用Windows函数 CreateTimer CreateTimerQueueTimer CreateTimer 等。现在我的问题是如何在 Linux 中使用 C ++ 来做同样的事情 code>?有没有一些API? timer_create 是一个很好的选择吗?如果还提供了示例,这将非常有帮助。



谢谢。

解决方案

您是否可以使用 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 ?

这篇关于在Linux中使用C ++创建计时器队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆