Skip to content

Instantly share code, notes, and snippets.

@davnicwil
Last active December 28, 2022 22:24
Show Gist options
  • Save davnicwil/2428141a4c2d7b1ae8a0199ee4a4a605 to your computer and use it in GitHub Desktop.
Save davnicwil/2428141a4c2d7b1ae8a0199ee4a4a605 to your computer and use it in GitHub Desktop.
Rough CPU benchmark
start=`date +%s`;num=0;for ((n=0;n<100000000;n++));do num=$(($num+(1 + $RANDOM % 10)));done; end=`date +%s`;runtime=$(($end-$start));echo "result is $num, took $runtime seconds";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment