This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: measure the execution time of each thread
- From: Michael Bergandi <mbergandi at gmail dot com>
- To: moktar_bouain <moktarbouain at yahoo dot fr>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Mon, 18 Apr 2011 13:02:49 -0400
- Subject: Re: [ECOS] measure the execution time of each thread
- References: <31407684.post@talk.nabble.com>
> I create an application with eCos containing 3 threads,i like to measure the
> execution time of each thread ??
http://ecos.sourceware.org/docs-latest/ref/kernel-clocks.html
static cyg_tick_count_t run_time;
cyg_tick_count_t start, end, run_time;
while (1) {
start = cyg_current_time();
<processing ...>
end = cyg_current_time();
run_time = end - start;
}
Then you just need to convert ticks to time, based on the tick rate
for your platform.
--
Mike
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss