Skip to content

Instantly share code, notes, and snippets.

@piotrze
Created April 29, 2019 13:40
Show Gist options
  • Save piotrze/e7aef623553a4a5b26d28a8e4e1c84d3 to your computer and use it in GitHub Desktop.
Save piotrze/e7aef623553a4a5b26d28a8e4e1c84d3 to your computer and use it in GitHub Desktop.
log message with time and memory
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