Last active
February 12, 2016 15:19
-
-
Save MartinKoerner/20f57509a2b3cebc5d69 to your computer and use it in GitHub Desktop.
Small benchmark for closure tree specs
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' | |
TEST_COUNT = 20 | |
overall_seconds = 0 | |
tm_outer = Benchmark.measure do | |
TEST_COUNT.times do |n| | |
puts "Test run #{n+1}" | |
tm_inner = Benchmark.measure do | |
`rake spec all` | |
end | |
printf("%.2f seconds\n", tm_inner.real) | |
overall_seconds += tm_inner.real | |
end | |
end | |
puts '=== Result:' | |
puts tm_outer.inspect | |
printf("%.2f seconds\n", tm_outer.real) | |
puts '=== Average:' | |
printf("%.2f seconds\n", overall_seconds / TEST_COUNT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment