benchmark
来源:互联网 发布:2017年病退工资的算法 编辑:程序博客网 时间:2024/05/18 03:59
require 'benchmark'
n = 1000000
Benchmark.bm do |x|
x.report {
for i in 1..n;
a = "1";
end
}
x.report {
n.times do;
a = "1";
end
}
x.report {
1.upto(n) do;
a = "1";
end
}
end
# user system total real
# 0.480000 0.000000 0.480000 ( 0.481000)
# 0.571000 0.000000 0.571000 ( 0.581000)
# 0.581000 0.000000 0.581000 ( 0.581000)
- benchmark
- Benchmark
- benchmark
- Benchmark
- GC1030 benchmark
- my benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- Factstone Benchmark
- hdfs benchmark
- apache benchmark
- Factstone Benchmark
- Apache benchmark
- JaConTeBe benchmark
- UVA10916Factstone Benchmark
- SpecMPI2007 benchmark
- Benchmark: each_key vs each vs each_pair
- NetAdvantage控件的汉化办法
- 如何批量新建文件
- Linux核心调试环境的搭建
- <<
- benchmark
- W1
- chomp
- html
- inject
- jsp
- each_pair
- Eclipse
- each