Module: Soy::Helpers

Included in:
Builder, Cli
Defined in:
lib/soy/helpers.rb

Overview

Utility methods to be used across classes

Instance Method Summary collapse

Instance Method Details

#elapsedObject

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