Useful ruby snippet: Create ping-like command line interfaces for proxy request testing

interrupted = false
trap("INT") { interrupted = true }
        
loop do
  # Do a lot of incredible things … ;-)

  if interrupted
    exit
  end
end

This is pretty handy for ad hoc benchmarking of pings, network issues, and other things.

Sit in a loop and just wait til I feel like I got enough data....

Posted