[CUBE] PL 1.2 Shipping!

Arturo Pérez arturo at ethicist.net
Thu Feb 6 21:13:45 PST 2003


On Thursday, February 6, 2003, at 10:32  PM, Laurie A Duncan wrote:

> On 2/6/03 10:10 PM, arturo at ethicist.net typeth:
>
>> Anyone out there with a dual?  Under OSX, in the terminal, do 
>> something
>> like this (this is all one line, BTW):
>>
>> sh -c 'i=0;while [ $i -lt 100 ] ; do i=`expr $i + 1`; echo $i; done' |
>> sh -c 'j=0; while read k ; do j=$j$k; done;'
>>
>> This uses a process to generate 100 numbers and another reads the
>> numbers.  The above should go twice on fast on a dual.
>
> I have a PL dual 800.
>
> Believe it or not, I'm not a unix geek, so the terminal stuff gets 
> lost on
> me.  I'm happy to run this, but what should I be looking at for a 
> result
> output and what are you comparing it to?

Here's what you need to do.  Put the following into a file named cpu.sh:

#! /bin/sh
i=0
j=0
while [ $i -lt 100 ]
do
         i=`expr $i + 1`
         echo $i
         done |
     while read k ; do j=$j$k; done;

After putting the above in cpu.sh do a
	chmod 777 cpu.sh
then do
	time ./cpu.sh

You'll see some statistics like so:

% time ./cpu.sh
0.150u 1.100s 0:01.47 85.0%     0+0k 0+0io 0pf+0w

The first # is user cpu seconds consumed (0.150u) then
the second # is system cpu seconds consumed (1.100s) then
the third number is elapsed time (0:01.47)  in minutes:seconds
the fourth number is percentage of total available CPU time consumed 
(85%)

Alternatively you can use the other "time" command and get somewhat 
simplified output:

/usr/bin/time ./cpu.sh
         1.31 real         0.21 user         1.04 sys


If you would (or need :-) the test to take longer just modify the

while [ $i -lt 100 ]

to something like

while [ $i -lt 1000 ]

At 1000 I get on my 450MHz Cube
/usr/bin/time ./cpu.sh
        13.80 real         2.18 user        10.20 sys

Thirteen seconds to count to 1000 :-)



More information about the Cube mailing list