From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23177 invoked by alias); 22 Oct 2003 21:02:11 -0000 Mailing-List: contact ecos-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@sources.redhat.com Received: (qmail 23170 invoked from network); 22 Oct 2003 21:02:10 -0000 Received: from unknown (HELO PH01SRV02.photuris.com) (141.150.26.4) by sources.redhat.com with SMTP; 22 Oct 2003 21:02:10 -0000 Received: by ph01srv02.photuris.com with Internet Mail Service (5.5.2656.59) id ; Wed, 22 Oct 2003 11:15:09 -0400 Message-ID: From: Doug Fraser To: 'Nick Garnett' , Luca Formaggio Cc: ecos-discuss@sources.redhat.com Date: Wed, 22 Oct 2003 21:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [ECOS] to consume cpu time X-SW-Source: 2003-10/txt/msg00402.txt.bz2 One method of forcing nanosecond delays that I have used is to read from FLASH. It is usually not cached (to avoid programming problems) and also responds in fixed time to a read cycle for most hardware. For example, on our MPC850 based hardware, a FLASH read (Intel Strata) responds in exactly 150nS. You can get very consistent delay loops this way. Doug Fraser > -----Original Message----- > From: Nick Garnett [mailto:nickg@ecoscentric.com] > Sent: Wednesday, October 22, 2003 6:17 AM > To: Luca Formaggio > Cc: ecos-discuss@sources.redhat.com > Subject: Re: [ECOS] to consume cpu time > > > Luca Formaggio writes: > > > Hi. I need to consume a cpu time in a program. This > > time is in nanoseconds. Is there a ecos function that > > consume time in nanoseconds? If it exists, how I call > > this function from my program? > > There's nothing in eCos that can handle that. The best we have is > HAL_DELAY_US() which approximates a given microsecond delay. > > If you want to insert delays for sub-microsecond periods then the best > approach is probably to use timed code loops. Even then, your timing > is going to be thrown out by any interupts. Even cache misses or DRAM > refresh cycles may affect you. > > -- > Nick Garnett eCos Kernel Architect > http://www.ecoscentric.com The eCos and RedBoot experts > > > -- > Before posting, please read the FAQ: > http://sources.redhat.com/fom/ecos > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss