Last active
February 22, 2020 11:05
-
-
Save lccxx/89c61458d0e5b9a8d2d3b857b10db032 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 "http/client" | |
sum = 0 | |
100.times { | |
spawn { | |
10000.times { | |
HTTP::Client.get("http://127.0.0.1/") { |res| sum += 1 } | |
} | |
} | |
} | |
old_sum = sum | |
loop { | |
sleep 1 | |
per_second = sum - old_sum | |
break if per_second == 0 | |
puts "per second: #{per_second}, sum: #{sum}" | |
old_sum = sum | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment