Answers for "ram consumption time caculate"

0

ram consumption time caculate

import time
import memory_profiler

t1=time.process_time()
before_mem = memory_profiler.memory_usage()
for i in range(1):
    print(i)
after_mem = memory_profiler.memory_usage()
t2=time.process_time()

print(format(t2-t1))
print("Memory (Before): {}Mb".format(before_mem))
print("Memory (After): {}Mb".format(after_mem))
Posted by: Guest on May-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language