Skip to content

Instantly share code, notes, and snippets.

@aaronjensen
Last active August 29, 2015 14:19
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 aaronjensen/6860a53d74ff03eecca8 to your computer and use it in GitHub Desktop.
Save aaronjensen/6860a53d74ff03eecca8 to your computer and use it in GitHub Desktop.
require 'socket'
require 'benchmark'
puts Benchmark.measure { Socket::gethostbyname(Socket::gethostname) }
# 0.000000 0.000000 0.000000 ( 5.004441)
# fix, in /etc/hosts: 127.0.0.1 localhost my-host.local
# OR: enable IPv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment