Yes, as the title says, I thought I'd care The execution time can be done with almost standard functions, maybe. Execution time method 1 % time test.py The time is output by inputting real 0m0.109s user 0m0.072s sys 0m0.036s
It seems that the time command was not particularly different from my mac or ubuntu.
Execution time method 2 import time start=time.clock()
end=time.clock() print end-start
If you put it from the beginning to the end, the overall speed, if you embed it in a specific class, pinpoint it.
Memory usage method 1 import resource ru = resource.getrusage(resource.RUSAGE_SELF) print ru.ru_maxrss
This is just like the total usage.
Memory usage method 2 from guppy import hpy h = hpy()
print h.heap()
If you put this in the beginning and the end again, it just comes out quite finely and at a glance it is something that is too much information for me.
Recommended Posts