delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/02/26/20:17:59

X-Spam-Check-By: sourceware.org
Message-ID: <45E386B2.1070506@gmail.com>
Date: Tue, 27 Feb 2007 09:17:38 +0800
From: Carlo Florendo <subscribermail AT gmail DOT com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: does usleep() sleep more than it's supposed to?
References: <45E292D6 DOT 30906 AT gmail DOT com> <ba40711f0702260647w127f2c26se19d8a002bfec14a AT mail DOT gmail DOT com>
In-Reply-To: <ba40711f0702260647w127f2c26se19d8a002bfec14a@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Lev Bishop wrote:
> On 2/26/07, Carlo Florendo  wrote:
>> I'm writing an application that requires time precisions up to the
>> microsecond level.  However, I put a hard-coded adjustment of
>> 9000 microseconds since usleep() seems to sleep on the average of
>> 9000 microseconds more than it's supposed to, at least on my
>> system.  I could work with up to 2000 microseconds for
>> function overhead but 9000 microseconds seems to be too long.
>>
>> I've attached a simple test case that let's usleep() sleep at
>> 100000 microseconds at each call.
>>
>> I've also included the output of cygcheck -svr.
>>
>> The output of the attached code on my system is the following:
> 
> FWIW, I don't see this:
> Print elapsed time at every call to usleep()
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:100000
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:100000
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:100000
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:101000
> Elapsed time (sec:microsec) 0:100000
> 
> Print elapsed after the loop()
> Elapsed time (sec:microsec) 0:100000

Excellent! It seems your system has been tuned based on the
code sent by Brian Ford on this thread.

Thank you very much.

Best Regards,

Carlo

-- 
Carlo Florendo
Softare Engineer/Network Co-Administrator
Astra Philippines Inc.
UP-Ayala Technopark, Diliman 1101, Quezon City
Philippines
http://www.astra.ph

Member of the Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019