Hi there, I wrote a time-loop function in my script wich is like this:
import numpy as np
def time_loop():
for i in range(0,10000000): # assume this is a time loop from x1 year x2 month x3 day to y1 year y2 month y3 day
# some codes
....
if __name__ == '__main__':
time_loop()
And I want to detect the memory usage of every line within the function time_loop. so how can I do that? does it simply follow:
import numpy as np
from memory_profiler import profile
@profile
def time_loop():
for i in range(0,10000000): # assume this is a time loop from x1 year x2 month x3 day to y1 year y2 month y3 day
# some codes
....
if __name__ == '__main__':
time_loop()
Then python -m memory_profile myscript.py? Thanks!
Hi there, I wrote a time-loop function in my script wich is like this:
And I want to detect the memory usage of every line within the function
time_loop
. so how can I do that? does it simply follow:Then
python -m memory_profile myscript.py
? Thanks!