X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <4783C381.3020800@huarp.harvard.edu>
Date: Tue, 08 Jan 2008 13:40:01 -0500
From: Norton Allen <allen@huarp.harvard.edu>
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: Mr Webber <captain_webber@hotmail.com>, cygwin@cygwin.com
Subject: Re: Does clock() work?
References: <4783B96D.9060709@huarp.harvard.edu> <BAY113-DAV35E3128C323B5B930C496F5480@phx.gbl>
In-Reply-To: <BAY113-DAV35E3128C323B5B930C496F5480@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass (ent.arp.harvard.edu: 10.0.0.122 is authenticated by a trusted mechanism)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Mr Webber wrote:
> CLOCKS_PER_SEC is a machine dependent macro, but not so machine dependent to
> recognize that my 32-bit windows box has dual processors.  Not useful for
> benchmarking, is it.
>   
It's not quite clear to me why multiple processors would affect the 
interpretation of CLOCKS_PER_SEC, or why such a simple model would not 
work in a single-threaded app for basic benchmarking. I'm not talking 
about a utility to launch commercial apps (which might be multithreaded, 
etc.), just:

    * record the current time
    * do something single-threaded
    * record the current time and calculate elapsed time

> clock is not the way to go. It is a crude estimation of processor time.  On
> regular UNIX times(2) is the function to use -- cygwin does not seem to have
> it.
>   
Any other suggestions for timing resolution better than one second on 
cygwin?

-Norton


--
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/

