Вы можете сделать это с помощью сокетов, например:
require "socket"
# START MEASURING CONNECTION TIME
connection = TCPSocket.open("example.com", 80)
# END MEASURING CONNECTION TIME
connection.print "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
# START MEASURING RESPONSE FETCHING TIME
response = connection.read
# END MEASURING RESPONSE FETCHING TIME
connection.close