i=0; while :; do A=$(ps -C threads3 -o ppid,pid,cmd,rss --no-headers); [ -n "$A" ] && echo $i $A || i=0 ; sleep 1; i=$(($i+1)); done