Skip to content

Instantly share code, notes, and snippets.

@rainly
Forked from alvin2ye/benchmark-demo.rb
Created March 23, 2011 09:59
Show Gist options
  • Select an option

  • Save rainly/882881 to your computer and use it in GitHub Desktop.

Select an option

Save rainly/882881 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'benchmark'
def method_1
`curl -s #{ARGV.first} | echo`
end
10.times do |i|
sleep 1
elapsed_time = Benchmark.realtime do
method_1
end
puts "#{i}: #{elapsed_time}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment