Sha256: deb2b732cdf6fbbb9fd93a850395ed186346c677ee3c8c6c3937ed855f03ee69
Contents?: true
Size: 394 Bytes
Versions: 10
Compression:
Stored size: 394 Bytes
Contents
module HelperClasses class Timing def initialize(dbg = 0) @dbg_lvl = dbg @time = Time.now end def probe(msg = '') t = sprintf('%6f', (Time.now - @time).to_f) dputs(@dbg_lvl) { "#{msg}: #{t}" } @time = Time.now end def self.measure(msg = '', dbg = 0) t = Timing.new(dbg) ret = yield t.probe(msg) ret end end end
Version data entries
10 entries across 10 versions & 2 rubygems