Module: Lighthouse::LettersGenerator

Defined in:
lib/lighthouse/letters_generator/service.rb,
lib/lighthouse/letters_generator/configuration.rb,
lib/lighthouse/letters_generator/service_error.rb,
lib/lighthouse/letters_generator/veteran_sponsor_resolver.rb

Defined Under Namespace

Classes: Configuration, Service, ServiceError, VeteranSponsorResolver

Class Method Summary collapse

Class Method Details

.measure_time(msg) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lighthouse/letters_generator/service.rb', line 10

def self.measure_time(msg)
  start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)

  response = yield

  end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  elapsed = end_time - start_time

  Rails.logger.info "#{msg}: #{elapsed} seconds"
  response
end