Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

yardoc

  • Loading branch information...
commit c80e8f8de269fefd17f80927239757853af80437 1 parent ecb599d
@timocratic authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/benchmark/timed_each.rb
View
9 lib/benchmark/timed_each.rb
@@ -1,6 +1,15 @@
require 'benchmark'
module Benchmark
+ # Iterate over the passed in collection, outputing benchmark info at each step
+ #
+ # @param [Enumerable] collection the collection to iterate over
+ # @param [Hash] options the collection to iterate over
+ # @option options [String] :start_caption ("Started processing collection\n") Output before starting
+ # @option options [String] :finish_caption ("Finished processing collection") Output when finished, on same line as total time
+ # @option options [String] :format ("- %r\n") Format String for benchmark (fmtstr)
+ # @option options [Symbol, String] :item_to_s (:to_s) Output before starting
+
def self.timed_each(collection, options={}, &block)
caption = options[:start_caption] || "Started processing collection\n"
finish_caption = options[:finish_caption] || "Finished processing collection"
Please sign in to comment.
Something went wrong with that request. Please try again.