Sha256: 009c126fcaa994e661ee6b28221bfa53372fed5162dae03bb218cf5c7f6579ae

Contents?: true

Size: 289 Bytes

Versions: 36

Compression:

Stored size: 289 Bytes

Contents

module Picky

  # Helper methods for measuring, benchmarking, logging.
  #
  module Helpers
    module Measuring

      # Returns a duration in seconds.
      #
      def timed
        time_begin = Time.new

        yield

        (Time.new - time_begin).to_f
      end

    end
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
picky-4.22.0 lib/picky/helpers/measuring.rb
picky-4.21.2 lib/picky/helpers/measuring.rb
picky-4.21.1 lib/picky/helpers/measuring.rb
picky-4.21.0 lib/picky/helpers/measuring.rb
picky-4.20.2 lib/picky/helpers/measuring.rb
picky-4.20.1 lib/picky/helpers/measuring.rb
picky-4.20.0 lib/picky/helpers/measuring.rb
picky-4.19.7 lib/picky/helpers/measuring.rb
picky-4.19.6 lib/picky/helpers/measuring.rb
picky-4.19.5 lib/picky/helpers/measuring.rb
picky-4.19.4 lib/picky/helpers/measuring.rb
picky-4.19.3 lib/picky/helpers/measuring.rb
picky-4.19.2 lib/picky/helpers/measuring.rb
picky-4.19.1 lib/picky/helpers/measuring.rb
picky-4.19.0 lib/picky/helpers/measuring.rb
picky-4.18.0 lib/picky/helpers/measuring.rb