From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glynn Clements Subject: Re: timing Date: Wed, 1 May 2002 19:20:30 +0100 Sender: linux-c-programming-owner@vger.kernel.org Message-ID: References: <3CCFD6BA.1D667C11@cs.unt.edu> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <3CCFD6BA.1D667C11@cs.unt.edu> List-Id: Content-Type: text/plain; charset="us-ascii" To: Mehran Rezaei Cc: C news group , gcc news group Mehran Rezaei wrote: > For the sake of performance analysis of some programs, I am using > clock() function call. I am running the programs on a linux box (Redhat > 7.2, and my machine is i686). > However, I am not getting the correct results as I expected. Perhaps I > miss something necessary for using timing function calls. [snip] > To my understanding both printfs should at least show 10 seconds > (because of "sleep(10)"). But they do not. clock() reports the amount of CPU time used by the program. sleep() will use negligible CPU time (probably too small to measure). -- Glynn Clements