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-0.10.5 lib/picky/helpers/measuring.rb
picky-0.10.4 lib/picky/helpers/measuring.rb
picky-0.10.2 lib/picky/helpers/measuring.rb
picky-0.10.1 lib/picky/helpers/measuring.rb
picky-0.10.0 lib/picky/helpers/measuring.rb
picky-0.9.4 lib/picky/helpers/measuring.rb
picky-0.9.3 lib/picky/helpers/measuring.rb
picky-0.9.2 lib/picky/helpers/measuring.rb
picky-0.9.1 lib/picky/helpers/measuring.rb
picky-0.9.0 lib/picky/helpers/measuring.rb
picky-0.3.0 lib/picky/helpers/measuring.rb
picky-0.2.4 lib/picky/helpers/measuring.rb
picky-0.2.3 lib/picky/helpers/measuring.rb
picky-0.2.2 lib/picky/helpers/measuring.rb
picky-0.2.1 lib/picky/helpers/measuring.rb
picky-0.2.0 lib/picky/helpers/measuring.rb
picky-0.1.0 lib/picky/helpers/measuring.rb