RajSanpui
RajSanpui

Reputation: 12064

HTimer in Linux (High resolution timer)

Does somebody has any idea of HT Timer in Linux? I will be glad if someone shares some code snippets with examples of how to implement the same.

Thanks in advance

Upvotes: 2

Views: 1167

Answers (2)

Maxim Egorushkin
Maxim Egorushkin

Reputation: 136208

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().

Upvotes: 2

Sergei Nikulov
Sergei Nikulov

Reputation: 5110

Here similar question with sample code for clock_gettime().

Upvotes: 1

Related Questions