Is there a command that's useful for doing a benchmark test on a separate command or function; to see how cpu intensive it is?Preferably something similar to how you can report the duration of a command with time.For instance: I tried the following code; before adding sleep 0.1; and it stressed the CPU, fans kicked into high gear, etc. Adding sleep 0.1 after each printf seemed to mitigate the problem. And basically, I'm just curious to check out the difference:spin (){    i=0     sp='/-\|'     n=${#sp}     printf ' '     sleep 0.1    while true; do         printf '\b%s' ${sp:i++%n:1}         sleep 0.1    done}Source: http://mywiki.wookedge.org/BashFAQ/034
Testing CPU intensity of a single command or function
bash;time;benchmark;cpu usage;sleep