Sunday, January 24, 2021

Time | Memory Taken to execute a piece of code in Python

 Time Taken to run the code:

Generally, it is very hard to find which part of code is taking more time when you run the whole application. The below code snippet tells us time taken to run the function.

Memory used by Objects:

In Python we use the sys.getsizeof function to check the memory used by an object.




No comments:

Post a Comment

Element wise operation on LIST vs ARRAY

The use of arrays over lists: You can write  vectorised  code on numpy arrays, not on lists, which is  convenient to read and write, and con...