-
-
Save cb-v4s/1b0c4d2758c23051bf5c241dc466946e to your computer and use it in GitHub Desktop.
python script performance
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
| import time, memory_profiler | |
| i_mem = memory_profiler.memory_usage() | |
| start = time.time() | |
| myfunc() | |
| end = time.time() | |
| f_mem = memory_profiler.memory_usage() | |
| elapsed = end - start | |
| mem_diff = f_mem[0] - i_mem[0] | |
| print(f'Finished jobs in {elapsed} consuming a total of {mem_diff} MB to complete') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment