Mail Archives: cygwin/2003/10/17/03:14:04
"Shankar Unni" <shankar AT cotagesoft DOT com> 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 <stdio.h>
#include <assert.h>
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/
- Raw text -