[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] Getting current day and time under RTLinux




I am not sure about the do_gettimeofday_nolock() call regarding
resolution and space/time efficiency.

My suggestion would be, you could use the high resolution timers
available with the processor. If you are using MPC8xx or Pentium 
class of processor, these high res timer registers are avilable.
You could read them to get nano-second precision.

Search in http://linux-mag.com/ article where one article which 
gives the assembly snipets of using these registers and discusses
cost effectiveness of such code.

Hope this helps,

-Sas

Laurent.Kersten@alcatel.be wrote:
> 
> RTAI have do_gettimeofday_nolock which is a RT compatible variable of the kernel function do_gettimeofday, however, I have no idea how precise is it actually, I would suspect a resolution of about 10ms (linux tick). but I have no ideas of the actual
> precision.
> 
> Laurent
> 
> "Marc LE DOUARAIN" <mledouarain@garbarini.com> on 06/05/2001 05:38:40 PM
> 
> Please respond to rtl@fsmlabs.com
> 
> 
> 
>  To:      rtl@fsmlabs.com
> 
>  cc:      (bcc: Laurent KERSTEN/BE/ALCATEL)
> 
> 
> 
>  Subject: [rtl] Getting current day and time under RTLinux
> 
> 
> Hello Mailing-List !
> 
> How can I get time (day, month, year + hour, min, sec) under a RTLinux thread?
> I know the classic functions under Linux : gmtime() , localtime() , time() ... but under RTLinux?
> 
> Many thanks for help.
> 
> ----- End of forwarded message from owner-rtl@fsmlabs.com -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
> 
> ----- End of forwarded message from owner-rtl@fsmlabs.com -----
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/