LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2009, 01:32 AM   #1
m1n
Member
 
Registered: Feb 2009
Posts: 33

Rep: Reputation: 15
Smile About jiffies?


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.
 
Old 02-27-2009, 10:23 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,932

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by m1n View Post
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.
 
  


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
How to check the affection of jiffies overflow in kernel 2.4.18. shiner_chen Linux - Kernel 2 07-22-2008 09:37 PM
Jiffies Rawjoe Linux - Kernel 5 08-08-2006 08:42 AM
Jiffies a kernel only entity, or is it allowed in userspace also? pat_and_cami Programming 0 03-10-2006 01:36 AM
Kernel compiling problem, connected with jiffies.h zWaR Linux - Software 2 03-01-2006 06:30 PM
How jiffies get updated? iikent Linux - Newbie 3 03-13-2004 09:36 AM


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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration