tlokz Posted August 31, 2008 Share Posted August 31, 2008 Ok looked through it and could get proccess info and such and mem usage but no CPU usage funcs I need to check how much CPU usage a certain proccess is using I'm not a noob I know it will spike but I will have a timer on it so if its at like 60+ for more then 20 secs it will kill process Thnx in ahead Link to comment Share on other sites More sharing options...
tlokz Posted August 31, 2008 Author Share Posted August 31, 2008 Ok looked through it and could get proccess info and such and mem usage but no CPU usage funcs I need to check how much CPU usage a certain proccess is using I'm not a noob I know it will spike but I will have a timer on it so if its at like 60+ for more then 20 secs it will kill process Thnx in ahead Link to comment Share on other sites More sharing options...
rasim Posted August 31, 2008 Share Posted August 31, 2008 tlokzExample:$strComputer = "." $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") While 1 $StartTime = _GetProcTime("mplayerc.exe") Sleep(1000) $EndTime = _GetProcTime("mplayerc.exe") $total = Int(($EndTime - $StartTime) / 100000) ToolTip("mplayerc.exe used " & $total & "%", 10, 10, "CPU Usage") WEnd ToolTip("") Func _GetProcTime($sProcName) If Not ProcessExists($sProcName) Then Return SetError(1, 0, 0) Local $colProcesses, $objProcess, $sngProcessTime $colProcesses = $objWMIService.ExecQuery("Select * from Win32_Process Where name = '" & $sProcName & "'") For $objProcess in $colProcesses $sngProcessTime = ($objProcess.KernelModeTime + $objProcess.UserModeTime) Next Return $sngProcessTime EndFunc Link to comment Share on other sites More sharing options...
Andreik Posted August 31, 2008 Share Posted August 31, 2008 Or you can use this function When the words fail... music speaks. Link to comment Share on other sites More sharing options...
boshi Posted August 31, 2008 Share Posted August 31, 2008 yup. i notice too. when i run a game and using script i created using AutoIt, the game client freeze a few seconds when certain action taken. maybe because of the game is eating too much memory. Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 31, 2008 Share Posted August 31, 2008 Stop double posting. You were already advised about this in the other thread you started with the exact title you used for this one. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now