On Tue, Aug 22, 2000 at 03:03:25PM +0200, Klaus Keppler wrote:
> Hi,
> 
> How can i get the Real Time ( seconds since 1970, time_t) in an
> rt-thread. I need this time as timestamp for my aquired data. 
> 
> Because the system-time on my rtlinux-box drifts away many seconds the
> day, i would like to get the time from the RealTimeClockChip on the
> processor board, converted to time_t.


If you are only interested in seconds, you can use xtime.tv_sec,
which is generally not going to be off more than 10 ms, is
monotonic, and can be read atomically.

I have a kernel patch that reimplements the way that Linux
keeps time, making it completely dependent on the TSC instead
of the TSC/timer-1 hybrid approach that is used now.  One of
the side effects (i.e., the main reason I wrote it) is that 
you should be able to call gettimeofday() from a real-time task.
The real-time part isn't completely implemented yet, however,
because I started working on other stuff.

It will be at ftp://stm.lbl.gov/pub/realtime/patch-*-timekeeper
whenever I upload it.

You should also consider running NTP if your clock drifts badly.




dave...

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to