Project

General

Profile

Bug #2264 » test_sleep.rb

romuloceccon (Rômulo Ceccon), 10/25/2009 01:23 AM

 
require 'benchmark'

def check
(1..3).each {
puts Benchmark.measure {
i = 0
(1..100000).each {
i += 1
}
}
}
end

puts 'before:'
check

th = Thread.new do
loop do
sleep(1)
end
end

puts 'after:'
check
    (1-1/1)