LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-24-2010, 08:32 AM   #1
Mohammad Abdelhadi
LQ Newbie
 
Registered: Jul 2010
Posts: 9

Rep: Reputation: 0
Question The accuracy of the function get_rtc_time()


Hi,

I am trying to get the time of my wall clock from my wireless driver in form of "hh:mm:ss", so I used the function get_rtc_time() inside my driver to get that and it was done.
My question: Is it possible to increase the accuracy of this function, for example if I want to get the milliseconds and the Microseconds in additional to the first output?
If not, Is there any other function can do that?

the desired form is "hh:mm:ss:ms:us"

Thank you,

--Mohammad
 
Old 10-25-2010, 12:58 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
You can *get* microseconds ...
... but that doesn't mean that the number you get will be accurate.

It won't

Suggestion: gettimeofday ()

'Hope that helps
 
Old 10-25-2010, 10:00 PM   #3
alan99
Member
 
Registered: Mar 2010
Distribution: Debian
Posts: 180

Rep: Reputation: 31
Quote:
Originally Posted by Mohammad Abdelhadi View Post
Hi,

I am trying to get the time of my wall clock from my wireless driver in form of "hh:mm:ss", so I used the function get_rtc_time() inside my driver to get that and it was done.
My question: Is it possible to increase the accuracy of this function, for example if I want to get the milliseconds and the Microseconds in additional to the first output?
If not, Is there any other function can do that?

the desired form is "hh:mm:ss:ms:us"

Thank you,

--Mohammad
What do you mean wall clock? Is your computer mounted on the wall? Do you mean one of those wall clocks synchronized to a radio time standard? get_rtc_time is a kernel function call and is only as good as the hardware clock in your computer, which may be off a few seconds everyday, unless that is you have it synchronized to a NTP server. You will never get microsecond accuracy unless you have special hardware synchronized to a GPS receiver or an atomic clock. That would be very expensive.
 
Old 10-26-2010, 02:38 PM   #4
Mohammad Abdelhadi
LQ Newbie
 
Registered: Jul 2010
Posts: 9

Original Poster
Rep: Reputation: 0
Hi,

Thank you all for the replies,

Well, lets say that I want to increase the resolution of the time that I get from my clock, that's it!

I used the function do_gettimeofday() to get the time in microseconds.

--Mohammad
 
  


Reply



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
NTP Server Accuracy? ftekiner Linux - Networking 4 08-05-2013 04:50 AM
ifconfig RX TX accuracy tincboy Linux - Networking 4 10-04-2010 03:06 PM
Problems with SpamAssassin accuracy mgillespie Linux - Software 1 03-08-2010 03:16 PM
IP traffic accuracy petersum Linux - Networking 1 12-26-2006 12:17 AM
C++ Microsecond Accuracy timing CamelofCamelot Programming 2 12-22-2003 01:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:16 AM.

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
Open Source Consulting | Domain Registration