This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: How to convert time tick to real time
- To: David Geng <deli dot geng at ncl dot ac dot uk>
- Subject: Re: [ECOS] How to convert time tick to real time
- From: Jonathan Larmour <jlarmour at cygnus dot co dot uk>
- Date: Fri, 03 Nov 2000 21:41:09 +0000
- CC: ecos-discuss at sourceware dot cygnus dot com
- Organization: Red Hat UK Ltd.
- References: <001601c045d9$9e8044c0$5210f080@ncl.ac.uk>
David Geng wrote:
>
> Hi,
>
> I'd like to know the time consumed in running certain code, in order to
> compare different platform as well as profile this code. I used clock() and
> cyg_current_time() to get the differential time. On my 133MHz SA1100 board
> the result is 29986 and 1794 respectively, while 2726 and 1001 on i386
> platform with 6x86CPU of 266MHz.
>
> But, that is only system time, i.e., timer ticks passed. How can I convert
> it to real-time, such as second. I think there should be some system
> constant containing how many timer ticks within one second, or something
> like this. I can not find it, could any one help me?
You mean CLOCKS_PER_SEC as used with the ISO standard clock() function?
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault