Sha256: 49ae88f68f71960abc9ad095d0f77d52068f4eded1dc5e28fb43983df1d2a085
Contents?: true
Size: 519 Bytes
Versions: 11
Compression:
Stored size: 519 Bytes
Contents
require "benchmark" module CiviCrm module Profiling extend ActiveSupport::Concern included do private mattr_accessor :_profile end module ClassMethods def profile(&block) self._profile = [] block.call _profile.dup ensure self._profile = nil end def time(entity, action, &block) time = Benchmark.realtime(&block) if _profile _profile << [entity, action, time] end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems