title: best way to check used ressources of a python script?
body: <p>I've programmed different scripts and want to compare them regarding the CPU usage and the memory usage.
  I wanted to use <a href="https://psutil.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://psutil.readthedocs.io/en/latest/</a> to get the needed data but as my scripts have different execution times I'm wondering if psutil is the right library to go for.
  The scripts runtimes vary from 0.005 seconds to 3 seconds, so I can't really use functions like
  psutil.cpu_percent(interval = 1).</p>
  <p>Thanks in advance!</p>