From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Rodolfo Bamberg <rolfetas@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] [Newbie question| timer modes
Date: Thu, 24 May 2007 16:18:05 +0200 [thread overview]
Message-ID: <46559E9D.7090106@domain.hid> (raw)
In-Reply-To: <46559AC7.40302@domain.hid>
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
prev parent reply other threads:[~2007-05-24 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-24 14:01 [Xenomai-help] [Newbie question| timer modes Rodolfo Bamberg
2007-05-24 14:18 ` Gilles Chanteperdrix [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46559E9D.7090106@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=rolfetas@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.