All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] relationship of timestamp / timer functions
@ 2008-02-04 15:14 Axel Beierlein
  2008-02-04 15:25 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Beierlein @ 2008-02-04 15:14 UTC (permalink / raw)
  To: Xenomai-help@domain.hid

Hello,

which corresponding functions do i have to use when i try to get the  
correct timediff between two events. Especially i get an timestamp with  
every CAN Message (wich is implemented with rtdm_clock_read())and on the  
other side i get a timestamp in my Userspace application with  
rt_timer_tsc(). Are they are running at the same base so that i can use  
the difference of both returned values of the functions?

Axel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-help] relationship of timestamp / timer functions
  2008-02-04 15:14 [Xenomai-help] relationship of timestamp / timer functions Axel Beierlein
@ 2008-02-04 15:25 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2008-02-04 15:25 UTC (permalink / raw)
  To: Axel Beierlein; +Cc: Xenomai-help@domain.hid

On Mon, Feb 4, 2008 at 4:14 PM, Axel Beierlein <belatronix@domain.hid> wrote:
> Hello,
>
>  which corresponding functions do i have to use when i try to get the
>  correct timediff between two events. Especially i get an timestamp with
>  every CAN Message (wich is implemented with rtdm_clock_read())and on the
>  other side i get a timestamp in my Userspace application with
>  rt_timer_tsc(). Are they are running at the same base so that i can use
>  the difference of both returned values of the functions?

rt_timer_read() corresponds to rtdm_clock_read(), but rt_timer_read()
returns the date as a count of clock ticks whereas rtdm_clock_read()
returns the date as a count of nanoseconds. So, if you are running in
periodic mode, you should compare CAN message timestamps with
rt_timer_ticks2ns(rt_timer_read()), if you are running in aperiodic
mode, rt_timer_ticks2ns simply returns the same value, so you can
directly compare the value returned by rtdm_clock_read() and
rt_timer_read().

-- 
                                               Gilles Chanteperdrix


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-04 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-04 15:14 [Xenomai-help] relationship of timestamp / timer functions Axel Beierlein
2008-02-04 15:25 ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.