Skip to content

Instantly share code, notes, and snippets.

@osamu
Created April 13, 2016 04:05
def time
start = Time.now
yield
Time.now - start
end
db_configs.each do |config_name, config|
if (config.class == Hash)
if config.has_key?(:host)
elapsed = time { Mysql2::Client.new(config) }
puts "#{elapsed} #{config_name}"
else
config.each do |_config_name, _config|
elapsed = time { Mysql2::Client.new(_config) }
puts "#{elapsed} #{_config_name}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment