All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] [Newbie question| timer modes
@ 2007-05-24 14:01 Rodolfo Bamberg
  2007-05-24 14:18 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Rodolfo Bamberg @ 2007-05-24 14:01 UTC (permalink / raw)
  To: Xenomai help

I am trying to compare latencies between one-shot mode and periodic
mode. Is there a way to get the system's time expressed in nanoseconds
if I set the timer to periodic?
Thanks,
Rodolfo Bamberg


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

* Re: [Xenomai-help] [Newbie question| timer modes
  2007-05-24 14:01 [Xenomai-help] [Newbie question| timer modes Rodolfo Bamberg
@ 2007-05-24 14:18 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2007-05-24 14:18 UTC (permalink / raw)
  To: Rodolfo Bamberg; +Cc: Xenomai help

Rodolfo Bamberg wrote:
> I am trying to compare latencies between one-shot mode and periodic
> mode. Is there a way to get the system's time expressed in nanoseconds
> if I set the timer to periodic?

With the native API, use rt_timer_tsc and rt_timer_tsc2ns to convert to
nanoseconds. With the posix API, use clock_gettime(CLOCK_MONOTONIC).
Note that what you get is not exactly the system time, but rather the
TSC time, its origin is around the time of the boot, but it is
sufficient for measuring time differences.

Also note that measuring the latency in periodic mode makes little
sense, you will get a variable offset due to the fact that the periodic
task wake up times are aligned on the system timer ticks.

-- 
                                                 Gilles Chanteperdrix


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

end of thread, other threads:[~2007-05-24 14:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24 14:01 [Xenomai-help] [Newbie question| timer modes Rodolfo Bamberg
2007-05-24 14:18 ` 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.