开发者

HTimer in Linux (High resolution timer)

开发者 https://www.devze.com 2023-02-13 04:33 出处:网络
Does somebody has any idea of HT Timer in Linux? I will be glad if someone shar开发者_运维百科es some code snippets with examples of how to implement the same.

Does somebody has any idea of HT Timer in Linux? I will be glad if someone shar开发者_运维百科es some code snippets with examples of how to implement the same.

Thanks in advance


Depends on your application type.

For event-driven applications your event notification library (like libevent) should provide timer scheduling functionality.

There is also POSIX timer_create() function, that can deliver timer expiry as a signal or a callback in another thread. Latest Linux provides timerfd mechanism to deliver timer expirations through a regular file descriptor that can be registered with select()/poll()/epoll().


Here similar question with sample code for clock_gettime().

0

精彩评论

暂无评论...
验证码 换一张
取 消