close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_repos.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.

Changes between Initial Version and Version 1 of rock/easy_cpu_bench


Ignore:
Timestamp:
Aug 31, 2010, 1:43:44 PM (14 years ago)
Author:
rock
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rock/easy_cpu_bench

    v1 v1  
     1 * 資料來源:[http://www.linuxidc.com/Linux/2009-06/20495.htm Linux下一种简单易行的cpu benchmark方法]
     2 * 用Linux自带的bc计算器计算pi值的一種 benchmark
     3{{{
     4time echo "scale=5000; 4*a(1)" | bc -l -q
     5}}}
     6   * time是計時。scale是精準度,4*a(1)调用了反正切函数。由三角函数我们知道1的反正切是pi/4, pi=4* pi/4。 -l -q参数的意思请参照manpage
     7   * 这一行其实就是让bc计算1的反正切,计算精度是5000位。