Quote:
Originally Posted by m1n
Hi all. I have a question.
How to get amount in seconds for one jiffy and get this information from certain command to parse and use it in shell script (with out looking at source code)?
Thanks.
|
seconds = jiffies / HZ
Jiffies is just a counter of clock interrupts. You can use it as a relative timer, just like the gettimeofday function, but there's no access from user space that I know of.
If you look at the /proc/cpuinfo file, you'll see the CPU speed. You could parse it out, and do some simple math, but the most accurate way to do this would be to use the gettimeofday or settimer functions through C.