Sha256: 203c5e27dcaa0e507918b84fd6b9084707674234f578365230fe6afd47659703

Contents?: true

Size: 378 Bytes

Versions: 127

Compression:

Stored size: 378 Bytes

Contents

module Picky

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

      # Returns a duration in seconds.
      #
      def timed *args, &block
        block_to_be_measured = lambda &block

        time_begin = Time.now.to_f

        block_to_be_measured.call *args

        Time.now.to_f - time_begin
      end

    end
  end

end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
picky-4.2.0 lib/picky/helpers/measuring.rb
picky-4.1.0 lib/picky/helpers/measuring.rb
picky-4.0.9 lib/picky/helpers/measuring.rb
picky-4.0.8 lib/picky/helpers/measuring.rb
picky-4.0.7 lib/picky/helpers/measuring.rb
picky-4.0.6 lib/picky/helpers/measuring.rb
picky-4.0.5 lib/picky/helpers/measuring.rb
picky-4.0.4 lib/picky/helpers/measuring.rb
picky-4.0.3 lib/picky/helpers/measuring.rb
picky-4.0.1 lib/picky/helpers/measuring.rb
picky-4.0.0 lib/picky/helpers/measuring.rb
picky-4.0.0pre6 lib/picky/helpers/measuring.rb
picky-4.0.0pre5 lib/picky/helpers/measuring.rb
picky-4.0.0pre3 lib/picky/helpers/measuring.rb
picky-4.0.0pre2 lib/picky/helpers/measuring.rb
picky-4.0.0pre1 lib/picky/helpers/measuring.rb
picky-3.6.16 lib/picky/helpers/measuring.rb
picky-3.6.15 lib/picky/helpers/measuring.rb
picky-3.6.14 lib/picky/helpers/measuring.rb
picky-3.6.13 lib/picky/helpers/measuring.rb