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 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com From: "Alex Vinokur" Subject: Re: Percent of CPU this job got > 100% Date: Fri, 17 Oct 2003 09:13:15 +0200 Lines: 83 Message-ID: References: <20031016144119 DOT GA30475 AT redhat DOT com> X-Complaints-To: usenet AT sea DOT gmane DOT org X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 "Shankar Unni" wrote in message news:bmmjhd$mmf$1 AT sea DOT gmane DOT org... > Christopher Faylor wrote: > > > On Thu, Oct 16, 2003 at 08:38:33AM +0200, Alex Vinokur wrote: > > >>$ /bin/time -v a 1000 > >>[...] > >> Percent of CPU this job got: 133% > > > Automatic, built-in meanness at no extra charge. > > :-). > > Alex: is it possible your program is multi-threaded, and you have one of > those shiny new hyperthreading P4s? Remote, but that could give you this > behavior.. No, it isn't. Here is program t.c : ------------------ #include #include int main (int argc, char** argv) { int i; assert (argc > 1); for (i = 0; i < atoi(argv[1]); i++); return 0; } ------------------ > > But even otherwise, small discrepancies between wall clock and computed > CPU clock are not uncommon, and given that your running time is pretty > close to one CPU "HZ" tick, you can get weird anomalies like this. > > Try timing "a 1000000". > -- > Shankar. > =========================================== Windows 2000 Professional CYGWIN_NT-5.0 1.5.4(0.94/3/2) gcc version 3.3.1 (cygming special) GNU time 1.7 =========================================== $ gcc t.c $ command time -v a 1000 Command being timed: "a 1000" User time (seconds): 0.03 System time (seconds): 0.03 Percent of CPU this job got: 127% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.04 [---omitted---] $ command time -v a 100000000 Command being timed: "a 100000000" User time (seconds): 18.82 System time (seconds): 0.04 Percent of CPU this job got: 99% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:19.03 [---omitted---] ===================================== Alex Vinokur mailto:alexvn AT connect DOT to http://mathforum.org/library/view/10978.html news://news.gmane.org/gmane.comp.lang.c++.perfometer ===================================== -- 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/