Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Created July 7, 2009 06:09
Show Gist options
  • Save alvin2ye/141920 to your computer and use it in GitHub Desktop.
Save alvin2ye/141920 to your computer and use it in GitHub Desktop.
ruby benchmark
require 'benchmark'
def method_1
# `curl -d "password=403" http://wiki.agideo.com/agideowiki/authenticate >> /dev/null 2>&1 `
`curl http://f22.agideo.com >> /dev/null 2>&1 `
# `curl http://agi-alvin.javaeye.com >> /dev/null 2>&1 `
# `curl http://www.google.com >> /dev/null 2>&1 `
# `curl http://primy.agideo.com >> /dev/null 2>&1 `
# `curl http://douban.com >> /dev/null 2>&1 `
end
10.times do
sleep 1
elapsed_time = Benchmark.realtime do
method_1
end
p elapsed_time
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment