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.31.3 lib/picky/helpers/measuring.rb
picky-4.31.2 lib/picky/helpers/measuring.rb
picky-4.31.1 lib/picky/helpers/measuring.rb
picky-4.31.0 lib/picky/helpers/measuring.rb
picky-4.30.0 lib/picky/helpers/measuring.rb
picky-4.29.0 lib/picky/helpers/measuring.rb
picky-4.28.1 lib/picky/helpers/measuring.rb
picky-4.27.1 lib/picky/helpers/measuring.rb
picky-4.27.0 lib/picky/helpers/measuring.rb
picky-4.26.2 lib/picky/helpers/measuring.rb
picky-4.26.1 lib/picky/helpers/measuring.rb
picky-4.26.0 lib/picky/helpers/measuring.rb
picky-4.25.3 lib/picky/helpers/measuring.rb
picky-4.25.2 lib/picky/helpers/measuring.rb
picky-4.25.1 lib/picky/helpers/measuring.rb
picky-4.25.0 lib/picky/helpers/measuring.rb
picky-4.24.0 lib/picky/helpers/measuring.rb
picky-4.23.2 lib/picky/helpers/measuring.rb
picky-4.23.1 lib/picky/helpers/measuring.rb
picky-4.23.0 lib/picky/helpers/measuring.rb