Created
July 7, 2009 06:09
-
-
Save alvin2ye/141920 to your computer and use it in GitHub Desktop.
ruby benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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