HTimer in Linux (High resolution timer)
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().
精彩评论