Sha256: 27d8999f3b38ffcc2d6e8ac9083fe241d0fc833374b18833f99636d6b1aa8fa2
Contents?: true
Size: 303 Bytes
Versions: 7
Compression:
Stored size: 303 Bytes
Contents
def tm(msg="Thing") t = Time.now res = yield seconds = Time.now - t puts "#{msg} took #{seconds} seconds" res end def print_memory_usage! Thread.new do loop do mem = `ps -l #{Process.pid}`.to_a[1].split[8] puts "Memory: #{mem} #{Time.now}" sleep(10) end end end
Version data entries
7 entries across 7 versions & 2 rubygems