Permalink
Browse files

Added warning about :iterations being too high.

  • Loading branch information...
Pistos
Pistos committed Oct 9, 2008
1 parent 8c4c5e9 commit f7c7afc04118d28eb6bbfe275b498f6a636c29e3
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/better-benchmark.rb
View
@@ -59,6 +59,12 @@ def self.compare_realtime( options = {}, &block1 )
options[ :inner_iterations ] ||= 1
options[ :required_significance ] ||= 0.01
+ if options[ :iterations ] > 30
+ warn "You have set the number of iterations to #{options[ :iterations ]}. " +
+ "Using too many iterations may make the test results less reliable. " +
+ "Try increasing the number of :inner_iterations instead."
+ end
+
ComparisonPartial.new( block1, options )
end

0 comments on commit f7c7afc

Please sign in to comment.