LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   HPET timer programming in C (http://www.linuxquestions.org/questions/linux-software-2/hpet-timer-programming-in-c-750675/)

sarans1987 08-27-2009 01:35 PM

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!!!!

TB0ne 08-27-2009 01:58 PM

Quote:

Originally Posted by sarans1987 (Post 3659755)
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.

jdines 08-27-2009 03:22 PM

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 ;-)

sarans1987 09-08-2009 10:38 AM

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


All times are GMT -5. The time now is 02:30 PM.