Skip to content

Instantly share code, notes, and snippets.

@tmm1
Created August 27, 2008 21:41
Show Gist options
  • Save tmm1/7588 to your computer and use it in GitHub Desktop.
Save tmm1/7588 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sequel'
require 'mysqlplus'
class Mysql
unless method_defined? :sync_query
alias :sync_query :query
alias :query :async_query
end
end
DB = Sequel.connect('mysql://root@localhost', :max_connections => 20)
start = Time.now
(0..10).map do
Thread.new do
p DB['select sleep(2)'].all
end
end.map{|t| t.join }
p (Time.now - start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment