Module: Soy::Helpers
Overview
Utility methods to be used across classes
Instance Method Summary collapse
-
#elapsed ⇒ Object
Returns the time for executing the block, rounded to the sixth place.
Instance Method Details
#elapsed ⇒ Object
Returns the time for executing the block, rounded to the sixth place.
8 9 10 11 12 13 |
# File 'lib/soy/helpers.rb', line 8 def elapsed starting = Process.clock_gettime(Process::CLOCK_MONOTONIC) yield ending = Process.clock_gettime(Process::CLOCK_MONOTONIC) (ending - starting).round(6) end |