Networking Forums

Networking Forums > Computer Networking > Linux Networking > Getting "absolute" time in Linux

Reply
Thread Tools Display Modes

Getting "absolute" time in Linux

 
 
Boris Benenson
Guest
Posts: n/a

 
      11-14-2006, 06:34 PM
Is there a way in either standard or Real-time Linux to get "absolute
number of ticks (or seconds) since the Epoc (or some other configurable
starting point), regardless of the kernel clock resets via
settimeofday() and the RTC resets via hwclock set and regardless of the
system reboots?
 
Reply With Quote
 
 
 
 
Michael Heiming
Guest
Posts: n/a

 
      11-14-2006, 06:50 PM
In comp.os.linux.networking Boris Benenson <(E-Mail Removed)>:
> Is there a way in either standard or Real-time Linux to get "absolute
> number of ticks (or seconds) since the Epoc (or some other configurable
> starting point), regardless of the kernel clock resets via
> settimeofday() and the RTC resets via hwclock set and regardless of the
> system reboots?


man date
/%s

Good luck

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo (E-Mail Removed) | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 296: The hardware bus needs a new token.
 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      11-14-2006, 06:58 PM
Boris Benenson <(E-Mail Removed)> wrote:
> Is there a way in either standard or Real-time Linux to get
> "absolute number of ticks (or seconds) since the Epoc (or some other
> configurable starting point), regardless of the kernel clock resets
> via settimeofday() and the RTC resets via hwclock set and regardless
> of the system reboots?


"Absolute" relative to what? Anything on the system itself reporting
seconds will be subject to the vagaries of drift relative to other
systems/"true time" (if such a thing exists). (humor involving
general relativity etc omitted

rick jones
--
oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      11-18-2006, 04:06 AM
Michael Heiming <michael+(E-Mail Removed)> writes:

>In comp.os.linux.networking Boris Benenson <(E-Mail Removed)>:
>> Is there a way in either standard or Real-time Linux to get "absolute
>> number of ticks (or seconds) since the Epoc (or some other configurable


Do you mean real time or ticks of the computer clock?

>> starting point), regardless of the kernel clock resets via
>> settimeofday() and the RTC resets via hwclock set and regardless of the
>> system reboots?


What have kernel resets of rtc got to do with true time?


>man date
>/%s


That may or may not be a place to start.
Note that you want to make sure your clock is on true time ( ntp or chrony
should ensure that)


 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      11-18-2006, 08:40 AM

Boris Benenson wrote:
> Is there a way in either standard or Real-time Linux to get "absolute
> number of ticks (or seconds) since the Epoc (or some other configurable
> starting point), regardless of the kernel clock resets via
> settimeofday() and the RTC resets via hwclock set and regardless of the
> system reboots?


The 'time' function gives you the system's best estimate of the number
of seconds since the epoch. If that's what you want, that's the
function that gives it to you.

I don't know what you mean by regardless of kernel clock restets via
'settimeofday'. Presumably, if someone called 'gettimeofday', it was
because they had reason to believe it would improve the kernel's
estimate of the time since the epoch. If not, why would they have
called 'gettimeofday'?

DS

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Fwd: SPEWS DOLTS "SneakyP", "Kevin!:?)", "WindsorFox" SPAM braodbandnewsgroup] !:?) Broadband 0 11-30-2005 01:04 AM
Re: SPEWS SLIMES "WindsorFox", "Kevin-!:?)", "Spin Dryer" get the cold shoulder at broadband ng! SneakyP Broadband 0 11-29-2005 10:46 PM
Attention Plus.net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM broadband newsgroup !:?) Broadband 0 11-28-2005 04:28 AM
Attention Plus.Net Re: SPEWS DOLTS "WindsorFox", "Kevin-!:?)", "SpinDryer" SPAM braodband newsgroup !:?) Broadband 0 11-28-2005 03:03 AM
Any good books on "Linux Socket prog", also on "Linux Network prog"? GS Linux Networking 11 10-16-2005 05:23 PM



1 2 3 4 5 6 7 8 9 10 11