Skip to content

Instantly share code, notes, and snippets.

@airstrike
Created April 26, 2020 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save airstrike/e8d12d10af7ff661209fd4a2f00bf1f2 to your computer and use it in GitHub Desktop.
Save airstrike/e8d12d10af7ff661209fd4a2f00bf1f2 to your computer and use it in GitHub Desktop.
Misc process load monitoring snippets for Windows
@echo off
rem CPU load by process (e.g. python*)
echo "Python processes % Processor Time"
typeperf "\Process(python*)\% Processor Time" -sc 10 | grep / | sed -r 's/.*:(.*)/\1/g' | sed -r 's/[\",]+/ /g'
rem Total CPU Load
echo "Total CPU Load %"
@for /f %p in ('wmic cpu get loadpercentage ^| grep -P \d+') do @echo %p%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment