LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-27-2009, 12:35 PM   #1
sarans1987
LQ Newbie
 
Registered: Aug 2009
Posts: 6

Rep: Reputation: 0
Question HPET timer programming in C


Hi guys..I read on the net tat HPET(high precision event timer) is a source of accurate microsecond resolution timing in linux...I need help in writing a C program in linux 2.6 to read the HPET timer values at two different time instants to find the time elapsed...iam a programming newbie

Wud lov any help!!!!
 
Old 08-27-2009, 12:58 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,132

Rep: Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456
Quote:
Originally Posted by sarans1987 View Post
Hi guys..I read on the net tat HPET(high precision event timer) is a source of accurate microsecond resolution timing in linux...I need help in writing a C program in linux 2.6 to read the HPET timer values at two different time instants to find the time elapsed...iam a programming newbie

Wud lov any help!!!!
I suggest you look at the hpet.c code, for the 2.6 kernel module, to give you some ideas.
 
Old 08-27-2009, 02:22 PM   #3
jdines
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Rep: Reputation: 0
Question You are in way over your head

If you are newbie programmer you should not be hacking the Linux kernel. In order to access the HPET timer directly you need to be running in kernel space. This means modifying and recompiling a Linux kernel and rebooting into that kernel. Presumably you are trying to access it from user space? (assuming you know the difference)

Also, no offense, but please read http://www.catb.org/~esr/faqs/smart-questions.html , as that will benefit both you and every person to whom you want to ask a question. Congratulations for your efforts, and I encourage them. Still, if you will continue then you really, really, really, need to read and understand the ESR FAQ at the link above. I promise you will get much further, much faster, without annoying people or sitting back wondering why noone is responding to your question!

Good Luck!

(I almost didn't respond, but then thought back to my newbie days, and decided to take pity on you ;-)
 
Old 09-08-2009, 09:38 AM   #4
sarans1987
LQ Newbie
 
Registered: Aug 2009
Posts: 6

Original Poster
Rep: Reputation: 0
sry guys...

Thanks for the advice .. i will surely try and ask proper questions next time....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Tutorial: GUI Programming in Python For Beginners: Create a Timer in 30 Minutes LXer Syndicated Linux News 0 03-27-2009 06:41 AM
Multimedia timer (SMP friendly timer) bigqueso Linux - Kernel 0 03-15-2007 03:49 PM


All times are GMT -5. The time now is 05:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration