Created
August 27, 2008 21:41
-
-
Save tmm1/7588 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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