Created
April 29, 2019 13:40
-
-
Save piotrze/e7aef623553a4a5b26d28a8e4e1c84d3 to your computer and use it in GitHub Desktop.
log message with time and memory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def log(message) | |
memory = `ps -o rss -p #{$$}`.chomp.split("\n").last.to_i/1024 | |
puts "#{Time.now} #{memory}M #{message}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment