https://gmpy.dev/blog/2025/wheels-for-free-threaded-python-now-available-in-psutil #PythonCommunity #TechNews #CCode #Innovation #Celebration #HackerNews #ngated
Wheels for free-threaded Python now available for psutil
https://gmpy.dev/blog/2025/wheels-for-free-threaded-python-now-available-in-psutil
#HackerNews #Wheels #psutil #Python #FreeThreaded #Development #OpenSource
I want to measure run time of a Python program and compare it to /usr/bin/time. The script, t.py:
import psutil, time,
startSecs = psutil.Process(os.getpid()).create_time()
print("startup took %.3fs" % (time.time() - startSecs))
run as:
/usr/bin/time -f 'wall=%e' python3 t.py
output:
startup took 0.822s
wall=0.03
where 0.8s is quite obviously wrong, not only because of the wall=0.03, but because there is no noticeable wait of nearly a second. How come?
Introduction to psutil: A Python library for system monitoring and automation
https://www.recursiveneuron.com/2022/12/introduction-to-psutil-python-library.html
#psutil #python #programming #pythonlesson #pythontips #Python3