README.md in benches-0.1.0 vs README.md in benches-0.2.0

- old
+ new

@@ -3,30 +3,34 @@ Benches defines a simple benchmarking DSL that allows you to create benchmark routines for your Ruby code. ## Defining a Routine Create a folder called regimens. For each class that you want to benchmark, -create a file like integer.rb +create a file like integer_regimen.rb -integer_routine.rb +integer_regimen.rb ```ruby -routine 4, 'benches 400 reps of to_s' # no arguments -routine 30, 'benches 300 reps of * with (400)' # one argument -routine 'test_string', "benches 500 reps of gsub with (s, '')" # two arguments +subject 5 do + benches '500 reps of to_s in less than 5 seconds' + benches '400 reps of + in less than 2 seconds', 3 + benches '300 reps of * in less than 3 seconds', 400 +end + +subject 20 do + benches '500 reps of to_s in less than 5 seconds' + benches '400 reps of + in less than 2 seconds', 3 + benches '300 reps of * in less than 3 seconds', 400 +end ``` -This will return the benchmark results of running `4.to_s` 400 times, -`30 * 400` 300 times, and `'test_string'.gsub('s', '')` 500 times. +If the benchmarks runs within the allotted time, it will +be printed green, otherwise it will be printed red. -The command `benchpress` will run all of the regimens. +The command `benchpress` runs all of the regimen files ## Testing Simply run `rspec` to run the test suite. - -## Future Work - -- Allow benchmark results to be tested in block passed to routine ## Credits All code (c) Evan Hemsley 2014