Created
July 13, 2016 06:33
-
-
Save hlcfan/369a0673a36f6c3d99fc3bccfd1d729f to your computer and use it in GitHub Desktop.
Output how much memory used
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
| # gem 'get_process_mem' | |
| def print_usage(description) | |
| mb = GetProcessMem.new.mb | |
| puts "#{ description } - MEMORY USAGE(MB): #{ mb.round }" | |
| end | |
| def print_usage_before_and_after | |
| print_usage("Before") | |
| yield | |
| print_usage("After") | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment