Module: EasyTimer::ClassMethods
- Defined in:
- lib/easy_timer.rb
Instance Method Summary collapse
Instance Method Details
#timer(options = {}, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/easy_timer.rb', line 9 def timer( = {}, &block) start_time = Time.now yield total_time = Time.at(Time.now - start_time) if [:verbose] || [:v] return total_time.verbose else return total_time end end |