Class: Time
- Object
- Time
encoding: utf-8
Public Visibility
Public Class Method Summary
timer(&block) |
How long it takes to run the block in seconds. Returns: Float |
---|
Public Instance Methods Inherited from Object
Public Class Method Details
timer
public
Float
timer(&block)
How long it takes to run the block in seconds
[View source]
11 12 13 14 |
# File 'lib/rango/ext/time.rb', line 11 def self.timer(&block) start = Time.now.tap { block.call } return Time.now - start end |