This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: how to link "gettimeofday" with arm-elf-gcc?


On Thu, 2003-11-20 at 15:34, Yusuke Matsuoka wrote:
> Hi Andrew and Gary,
> 
> Thanks for the reply.
> 
> I want to run the KVM(K virtual machine for Java) on eCos and
> want to measure the exec time of my Java application on the board.
> The original KVM implementation uses "gettimeofday", and I got
> the linker error.
> 
> Since I need a *millisecond* resolution, is there a better way 
> rather than including snmp?
> I want to keep the footprint small.
> (ctime(time()) is a *second* resolution, right?)
> 

The eCos system clock will normally run at 10ms resolution.  If you
need something better than that, you could either run the system clock
faster (not recommended), or there are HAL functions which will let
you calculate finer grain times.

Look at ${ECOS_REPOSITORY}/kernel/current/tests/tm_basic.cxx for
an example of how to measure time down to micro-seconds (without any
changes to eCos or even the standard configuration).

> Thanks,
> Yusuke
> 
> > -----Original Message-----
> > From: ecos-discuss-owner@sources.redhat.com 
> > [mailto:ecos-discuss-owner@sources.redhat.com] On Behalf Of 
> > Andrew Lunn
> > Sent: Thursday, November 20, 2003 2:06 PM
> > To: Yusuke MATSUOKA
> > Cc: ecos-discuss@sources.redhat.com
> > Subject: Re: [ECOS] how to link "gettimeofday" with arm-elf-gcc?
> > 
> > 
> > > I got an error that linker cannot find "gettimeofday" as follows:
> > 
> > gettimeofday was added the posix only recently, so eCos does not yet
> > implement it as part of libc. 
> > 
> > Either use ctime(time()) or include the snmp stack which does have
> > gettimeofday().
> > 
> >         Andrew
> > 
> > -- 
> > Before posting, please read the FAQ: 
> > http://sources.redhat.com/fom/ecos
> > and search the list 
> > archive: http://sources.redhat.com/ml/ecos-discuss
> > 
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]