Using 'time' command with multiple background processes
To test various compiler optimizations, I'm running a shell script which runs several processes in the background simultaneously:
Code:
./readfile output1.clock.bin filter1.bin & I've tried various combinations of parentheses, &'s, &&'s, etc. but I can't seem to find the right syntax... I would like to be able to run N processes, in the background, simultaneously, in order to test the processing capabilities of my CPU. Thanks in advance! -Jordan |
Can you not just take the contents of your script and use them as actual command?
|
Add the cmd 'time' to the start of each cmd line and save the output to a numbered file
|
@chrism01,
Do you mean to make a separate output file for each command, and then to add up the times by hand? Take the average of the times? I would like to know how long it takes to run all 4 commands, simultaneously. Call it a simple experiment in parallel processing. I was looking for something like this: Code:
time ( command1 & ; command2 & ; command3 & ) |
Use wait:
Code:
$ cat sleep.sh |
@Mr. C: That's exactly what I needed. Thanks.
|
All times are GMT -5. The time now is 04:04 PM. |