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
2019-06-19 20:39:10 +12:00

15 lines
220 B
Ruby

# Plenty Thtread.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}