Subject: Re: [linux-audio-dev] best method for timing
From: Takashi Iwai (tiwai_AT_suse.de)
Date: Wed Apr 17 2002 - 12:37:00 EEST
At Tue, 16 Apr 2002 19:14:27 -0400,
Paul Davis wrote:
>
> Sure (thanks to Kai for pointing out <asm/timex.h>
>
> ----------------------------------------------------------------------
>
> #include <asm/timex.h>
>
> ...
> cycles_t cycles = get_cycles();
> ...
>
> ----------------------------------------------------------------------
>
> this will work on at least x86, ppc and alpha.
no, please don't include asm headers.
including asm headers makes the app fairly unportable, because
- asm headers are not the part of gcc header files, so it's uncertain
which file is used
- it depends on the kernel source version whether such a macro really
exists.
the best way is to retrieve the corresponding macro (e.g. get_cycles)
for each architecture from asm/timex.h, and merge it into your
source (or create a local header file).
ciao,
Takashi
This archive was generated by hypermail 2b28 : Wed Apr 17 2002 - 12:25:42 EEST