Print out a list of top 5 CPU using processes every second

prstat

prstat -c -n 5 -s cpu 1

click the source code to copy