#1 06 Nov 2010 23:18

Registered: 06 Nov 2010
Posts: 1

[Help] Using Time to measure several programs at once

Hello, basically I want to do this:

/usr/bin/time [...] head -$i input | tail -$step | sort -o x.$n.$i &

but time will only measure the running time of head!

how can I force time to measure the 3 commands?

I tried with ` head | ... | sort ` and failed cause time doesn't recognize

I though of putting those commands in a separate bash file, but I really didn't want to resort to that...

thx for your time


#2 03 May 2011 11:55

Registered: 03 May 2011
Posts: 1

Re: [Help] Using Time to measure several programs at once

Put the pipeline in brackets, e.g. ...

% time (head /etc/motd | sleep 5 ) # simulates a long running process
real    0m5.007s  # as you see, time reported for the entire pipeline
user    0m0.020s
sys     0m0.010s


Board footer

Powered by FluxBB