各位大虾,谁给我解释一下这段Ruby代码是干嘛的好吗??? 20
require'benchmark'threads=[]putsBenchmark.measure{50.times{threads<<Thread.new{i=0whi...
require 'benchmark'
threads = []
puts Benchmark.measure {
50.times {
threads << Thread.new {
i=0
while i<200000
/foo#{i}bar/
i+=1
end
}
}
threads.each {|t| t.join }
} 展开
threads = []
puts Benchmark.measure {
50.times {
threads << Thread.new {
i=0
while i<200000
/foo#{i}bar/
i+=1
end
}
}
threads.each {|t| t.join }
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询