Sha256: a2645a959ebb9233d329bc8b4aa4d4ca19bc5053fb9b4d5849d2e1a7706fe1f9
Contents?: true
Size: 474 Bytes
Versions: 20
Compression:
Stored size: 474 Bytes
Contents
module Lrama class Report module Duration def self.enable @_report_duration_enabled = true end def self.enabled? !!@_report_duration_enabled end def report_duration(method_name) time1 = Time.now.to_f result = yield time2 = Time.now.to_f if Duration.enabled? puts sprintf("%s %10.5f s", method_name, time2 - time1) end return result end end end end
Version data entries
20 entries across 20 versions & 1 rubygems