This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: Length of a system tick
- From: "Gernot Zankl" <zankl at decomsys dot com>
- To: "Gary Thomas" <gary at mlbassoc dot com>
- Cc: <ecos-discuss at sourceware dot org>
- Date: Fri, 24 Nov 2006 09:05:57 +0100
- Subject: RE: [ECOS] Length of a system tick
Hi Gary !
> > Does an easy way (API function,#define...) exists to find
> out how long
> > one system tick lasts (e.g. in nanoseconds) ?
> > I need this value in an application, which does/should not know the
> > exact ratio.
>
> Unless you change something, it will be 10ms.
I just do not want to code a constant inside the application, which is
is not determined by the appication itself, but rather by the used
kernel.
> You can also look at the CDL parameters to compute this.
> From 'tm_basic.cxx':
>
> static long rtc_resolution[] = CYGNUM_KERNEL_COUNTERS_RTC_RESOLUTION;
> long ns_per_system_clock = 1000000/rtc_resolution[1];
Thanks for your hint.
Works perfectly !
Regards,
Gernot Zankl
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss