Showing posts with label benchmark. Show all posts
Showing posts with label benchmark. Show all posts

Thursday, August 13, 2009

Bc as cpu benchmark

My previous post (http://tuxshell.blogspot.com/2009/08/shell-as-calculator.html) was about making math calculation in shell. I showed how to calculate PI number up to n digits. I thought, together with time command it can be used as CPU benchmark. This kind of calculation is cpu intensive and takes some time. Let's calculate up to 5000 digits after period. We measure the time of doing it with time command and look for real value:

$ time echo "scale=5000; a(1)*4" | bc -l

My computer did it within 37.194s. How about yours?