From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11805 invoked by alias); 30 May 2008 08:07:45 -0000 Received: (qmail 11792 invoked by uid 22791); 30 May 2008 08:07:43 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 30 May 2008 08:07:24 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1K1zdj-0007IP-00; Fri, 30 May 2008 10:07:07 +0200 Date: Fri, 30 May 2008 08:07:00 -0000 From: Andrew Lunn To: ariga masahiro Cc: "Paul D. DeRocco" , ecos-discuss@ecos.sourceware.org Message-ID: <20080530080707.GA27869@lunn.ch> Mail-Followup-To: ariga masahiro , "Paul D. DeRocco" , ecos-discuss@ecos.sourceware.org References: <000d01c8c226$6fa92140$1c0110ac@ariga> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000d01c8c226$6fa92140$1c0110ac@ariga> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: In trouble of timer operations X-SW-Source: 2008-05/txt/msg00121.txt.bz2 > I expected there are ways to synchronize with these ticks,and get as > close as 10ms delay. Simple cyg_thread_delay(1); cyg_thread_delay(1); The second call will be roughly synchronised to the tick. The first call will block until the tick. The second call will start shortly after the tick and last until shortly after the next system tick. I say roughly, because this is a RTOS. Any higher priority thread which wakes up at this system tick will get to run first and so delay when this thread gets to run. > And another thing.What I want to do is that I display time before calling > delay func(like cyg_thread_delay), > and display time again after returned from delay function. > Would you teach me how to do it. I suggest you use a different hardware timer which is free running. Set the period much higher so you don't have to deal with it wrapping around every 10ms. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss