Sha256: 3eedf18f216507cdf8c2f43eb8888b00734588d690a28f4609e4f4e128596b52

Contents?: true

Size: 357 Bytes

Versions: 57

Compression:

Stored size: 357 Bytes

Contents

# 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

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
picky-2.7.0 lib/picky/helpers/measuring.rb
picky-2.6.0 lib/picky/helpers/measuring.rb
picky-2.5.2 lib/picky/internals/helpers/measuring.rb
picky-2.5.1 lib/picky/internals/helpers/measuring.rb
picky-2.5.0 lib/picky/internals/helpers/measuring.rb
picky-2.4.3 lib/picky/internals/helpers/measuring.rb
picky-2.4.2 lib/picky/internals/helpers/measuring.rb
picky-2.4.1 lib/picky/internals/helpers/measuring.rb
picky-2.4.0 lib/picky/internals/helpers/measuring.rb
picky-2.3.0 lib/picky/internals/helpers/measuring.rb
picky-2.2.1 lib/picky/internals/helpers/measuring.rb
picky-2.2.0 lib/picky/internals/helpers/measuring.rb
picky-2.1.2 lib/picky/internals/helpers/measuring.rb
picky-2.1.1 lib/picky/internals/helpers/measuring.rb
picky-2.1.0 lib/picky/internals/helpers/measuring.rb
picky-2.0.0 lib/picky/internals/helpers/measuring.rb
picky-2.0.0.pre3 lib/picky/internals/helpers/measuring.rb
picky-2.0.0.pre2 lib/picky/internals/helpers/measuring.rb
picky-2.0.0.pre1 lib/picky/internals/helpers/measuring.rb
picky-1.5.4 lib/picky/internals/helpers/measuring.rb