Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

16 lines (13 sloc) 0.444 kb
require 'benchmark'
TIMES = (ARGV[0] || 5).to_i
Benchmark.bm(30) do |bm|
TIMES.times do
bm.report("control") { 100_000.times { Process } }
bm.report("Process.times") { 100_000.times { Process.times } }
bm.report("Process.times 10 threads") do
threads = (1..10).map {Thread.new{sleep}}
100_000.times { Process.times }
threads.each {|t| Thread.pass until t.status == 'sleep'; t.wakeup; t.join}
end
end
end
Jump to Line
Something went wrong with that request. Please try again.