Skip to content

Instantly share code, notes, and snippets.

@LAC-Tech
Created April 20, 2021 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LAC-Tech/49baa48c8e8ec3d635c85b51fafc9646 to your computer and use it in GitHub Desktop.
Save LAC-Tech/49baa48c8e8ec3d635c85b51fafc9646 to your computer and use it in GitHub Desktop.
require 'benchmark'
require 'net/http'
N = 100_000
{node: 'http://localhost:31337', ruby: 'http://127.0.0.1:9292'}.map do |name, url|
puts name
puts Benchmark.measure {
N.times do
Net::HTTP.get(URI(url))
end
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment