0

Is there a Python module that you can use to get execution stats for a piece of code or a python app ? For example something like:

get_stats.start() 
#python code 
stats = get_stats.end()

The stats I am interested in are cpu usage, ram usage and execution time

6
  • You could look into profilers Commented Jan 27, 2022 at 12:56
  • For execution time you can use the timeit module, for CPU/RAM usage I'd use an external program (e.g. Windows Task Manager, UNIX htop). Commented Jan 27, 2022 at 12:58
  • @jfaccioni I wish to avoid using an external program and just get the stats from the script itself Commented Jan 27, 2022 at 13:04
  • @Tobi208 hey. Thanks from what I see profilers only give time statistics right? No cpu or ram Commented Jan 27, 2022 at 14:26
  • How about this Commented Jan 27, 2022 at 14:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.