Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <6.0.1.1.0.20040708050901.01f75730@imap.myrealbox.com> X-Sender: tprince AT imap DOT myrealbox DOT com Date: Thu, 08 Jul 2004 05:20:45 -0700 To: "Alex Vinokur" , cygwin AT cygwin DOT com From: Tim Prince Subject: Re: What does clock() return? In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-IsSubscribed: yes At 09:01 PM 7/7/2004, Alex Vinokur wrote: >Here is an article >http://groups.google.com/groups?selm=2l2ucgF7jv50U1%40uni-berlin.de >from http://groups.google.com/groups?group=microsoft.public.vc.language > > >"Victor Bazarov" wrote in message >news:%23gH7pzEZEHA DOT 992 AT TK2MSFTNGP10 DOT phx DOT gbl... > > Is it a known issue that in VC++ RTL the function 'clock()' > > reports the wall clock instead of CPU time used? I ran this > > test program on Windows and Unix: A long standing "problem." As Win9x had no choice other than wall clock time, MSVCRTL gives you no choice. Other compiler vendors make the choice according to which version of Windows is running. If you choose ProcessTime(), the resolution is 0.010 seconds, which is unsatisfactory for many small benchmarks, so then we must over-ride it by using the rdtsc counter directly. Here is my understanding of the decision: for cygwin, the primary goal is compatibility with gcc running on other OS. For mingw, the goal is compatibility with Microsoft practice, where feasible. Thus, no chance of compatibility between mingw and cygwin on this point. Tim Prince -- 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/