how to know which process consume CPU time more

Hi,

I have problem like everyday i have to check which process consuming more cpu time. I have done it manually using top command..
Is there any script which will tell the exact process name which will consuming more time. I am using hpux.

Can put this mini script into the crontab and have it run every minute for example, redirecting it's output to some log or the ps line in the script itself.

Z=0

while (( Z<=19 )); do
   echo `date`
   ps aux| sort -nrk 3,3| head -10
   sleep 3
   let Z=$Z+1
done

exit 0