Skip to content

Instantly share code, notes, and snippets.

@brianmario
Created April 5, 2011 15:16
Show Gist options
  • Save brianmario/903812 to your computer and use it in GitHub Desktop.
Save brianmario/903812 to your computer and use it in GitHub Desktop.
x = Benchmark.realtime do
threads = []
5.times do
threads << Thread.new { ActiveRecord::Base.connection.execute("select sleep(1)") }
end
threads.each {|t| t.join }
end
puts x
# $ RAILS_ENV=production script/rails runner bm.rb
# 1.04205107688904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment