Sha256: cce4c689af67a3cf3cb8aaf1fd0f0144ab0f1bc0bee90cd3bf22900f76638da2
Contents?: true
Size: 348 Bytes
Versions: 16
Compression:
Stored size: 348 Bytes
Contents
# encoding: utf-8 class Time # How long it takes to run the block in seconds # # @author Botanicus # @since 0.0.3 # @return [Float] How long it takes to run the block in seconds # @example # Time.timer { sleep 2 } # => 2.030802 def self.timer(&block) start = Time.now.tap { block.call } return Time.now - start end end
Version data entries
16 entries across 16 versions & 4 rubygems