-1
I have a code and I want to know how much he’s getting from the processor and the memory.
-1
I have a code and I want to know how much he’s getting from the processor and the memory.
1
If you are not using task manager, you can use psutils library
import psutil
print(psutil.cpu_percent()) # Em porcentagem, uso da CPU
print(psutil.virtual_memory()._asdict()) # Em dicionário informações de memória física
returns, for example:
14.2
Ordereddict(['total', 8272900096), ('available', 3767132160), ('Percent', 54.5), ('used', 4505767936), ('free', 3767132160)])
Edit: There is a process id approach as well, "a little' more complex if you don’t like it.
Browser other questions tagged python-3.x
You are not signed in. Login or sign up in order to post.
Ctrl+Shift+Esc on Windows 10 and analyze the python.exe process
– Breno
This command opens the Task Manager
– Breno
But there will show the data at runtime?
– Igor Valadares Queiroz