I've programmed different scripts and want to compare them regarding the CPU usage and the memory usage. I wanted to use https://psutil.readthedocs.io/en/latest/ 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).
Thanks in advance!