2

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

2
  • What would you like to achieve with a timer? Commented Feb 25, 2011 at 11:35
  • I have an application and it needs a timer to track it's execution. Commented Feb 25, 2011 at 13:59

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

Here similar question with sample code for clock_gettime().

2 Comments

I want fo HRTTimer code samples please (High resolution timers)
See code sample here. I believe it should fit your purposes well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.