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-1.5.3 lib/picky/internals/helpers/measuring.rb
picky-1.5.2 lib/picky/internals/helpers/measuring.rb
picky-1.5.1 lib/picky/internals/helpers/measuring.rb
picky-1.5.0 lib/picky/internals/helpers/measuring.rb
picky-1.4.3 lib/picky/internals/helpers/measuring.rb
picky-1.4.2 lib/picky/internals/helpers/measuring.rb
picky-1.4.1 lib/picky/helpers/measuring.rb
picky-1.4.0 lib/picky/helpers/measuring.rb
picky-1.3.4 lib/picky/helpers/measuring.rb
picky-1.3.3 lib/picky/helpers/measuring.rb
picky-1.3.2 lib/picky/helpers/measuring.rb
picky-1.3.1 lib/picky/helpers/measuring.rb
picky-1.3.0 lib/picky/helpers/measuring.rb
picky-0.12.3 lib/picky/helpers/measuring.rb
picky-0.12.2 lib/picky/helpers/measuring.rb
picky-0.12.1 lib/picky/helpers/measuring.rb
picky-0.12.0 lib/picky/helpers/measuring.rb
picky-0.11.2 lib/picky/helpers/measuring.rb
picky-0.11.1 lib/picky/helpers/measuring.rb
picky-0.11.0 lib/picky/helpers/measuring.rb