wiki:rock/easy_cpu_bench
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_core.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
  • 資料來源:Linux下一种简单易行的cpu benchmark方法
  • 用Linux自带的bc计算器计算pi值的一種 benchmark
    time echo "scale=5000; 4*a(1)" | bc -l -q
    
    • time是計時。scale是精準度,4*a(1)调用了反正切函数。由三角函数我们知道1的反正切是pi/4, pi=4* pi/4。 -l -q参数的意思请参照manpage
    • 这一行其实就是让bc计算1的反正切,计算精度是5000位。
Last modified 16 years ago Last modified on Aug 31, 2010, 1:43:44 PM