1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/vm_thread_pass.rb
Masato Ohba 6902824729
Fix typo in comment [ci skip]
s/Thtread/Thread
2019-08-10 09:35:28 +09:00

15 lines
219 B
Ruby

# Plenty Thread.pass
# A performance may depend on GVL implementation.
tmax = (ARGV.shift || 8).to_i
lmax = 400_000 / tmax
(1..tmax).map{
Thread.new{
lmax.times{
Thread.pass
}
}
}.each{|t| t.join}