Search the Community

Showing results for tags 'cpu'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General
    • Announcements and Site News
    • Chat
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office


  • Forum
  • AutoIt


  • Community Calendar

Found 9 results

  1. CPU_Widget_TimeSync



    The simple widget shows the percentage of cpu, ram used and the CPU temperature (WMI). - Every 30s check, sync and update time for computer. - Drag adn Drop any files on GUI for reset Attribute (-RAHS) and set Full Access to Everyone ! - Righ Click on x and click Un/Install app to boot with Windows! CPU_Widget_TimeSync.exe CRC32: 1956339E MD5: BFC2B596BD1EDA35D6B02B97F8FB57AE SHA-1: 796A663739EA5AC9890D9FA324A98E987F35E7C8 Function code from: CPU: RAM: MemGetStats ( ) Memory: _WinAPI_EmptyWorkingSet ()
  2. What am I supposed to do, if a program is able for a long time? My program is idle for 20 minutes, before doing a very tiny task, and then starting all over again. I tries using Sleep(), but that literally melts my CPU and pushes them up for 20 to 30%. Permanently checking the time costs too much CPU too. Any other way of doing this? Preferably without taking more than 1% CPU. It also needn't be exactly 20 minutes, everything between 15 and 25 is fine too Thanks!
  3. I've written a small surveillance tool for one of my programs. It shows the time that has already passed, the estimated time until the end, the average time of the steps, and the progress in %. It works pretty well, but I want to add some stats. That'd be the usages of the CPU, RAM, network and hard-drive of all threads in %. Basically what you see in the taskmanager, but without the list of every single process. I'm aware that there's no in-built function for that, and that I'd need an additional library. Are there any for that? Simply functions that return the stats mentioned above. Thanks! Edit: I run an ASUS R752M with an Intel BayTrail M3540 on Windows 10 64-bits.
  4. hello I have problem with ClipGet () function: If the clipboard contains a large amount of data the use of the function pushes the consumption of cpu resources to 100% and my script unresponds until I force it to end. I tried to work around the problem by limiting the size of the recovered data from the clipboard Local = $ClipBoardData = StringMid(ClipGet (), 1.1024) I also used: DllCall ("psapi.dll", "int", "EmptyWorkingSet", "long", -1) to free the memory after each call to ClipGet ()
  5. Good Morning AutoIT Geniuses! Maybe this question is answered somewhere already... but I'm looking to ramp up the priority or "speed" of my exe's. So, I've been experimenting and I don't see a huge increase in completion regardless of the processor or memory I use. Sure, if I increase the memory I don't run out of memory, but if I increase memory - things relatively stay the same... why is that? In another scenario for instance, I put the exe on a Dell server w/ 24 GB of ram and several quad core Xeon cpu's and the time to execute was relatively the same... Oh, and the CPU never spiked or went above 5%... even after I stepped up it's priority. That seemed impossible - so I'm asking - is AutoIT mostly responsible for system resources used or is it on Windows? I used WIndows 7 x64 and Windows Server 2012. Clueless as to what the guts are behind AutoIT and how Windows hands the exe's resources or how AutoIT "tells" Windows how to handle it's resources. This day in age, we have quad cores +++ and then some... so this app should be screaming fast - it's not like I'm playing Crysis in 8K - haha, lol.
  6. I took a script written by Beege, optimized the code, and removed the global variables. Its one function, reliable, and very easy to use or modify to your needs. I decided to post it because I found it very hard to find a reliable way to get the cpu percentage of a given process. I know that there are a few different methods but I deem WMI unreliable and everything I tried before optimizing this function was to slow i.e. freezing when other CPU intensive processes were active. When monitoring a potentially CPU intensive process, I found it necessary to increase the script's priority otherwise the script/system would freeze which is exactly what I was attempting to prevent! See Beege's updated post: #NoTrayIcon #include <WinAPI.au3> HotKeySet('{ESC}', '_Exit') Func _Exit() Exit EndFunc ;==>_Exit _LimitProcessCPU("MediaServer.exe", 10, 1, 5) Func _LimitProcessCPU($vProcess, $nLimit, $nInterval = 1, $nScriptPriority = 2) Local $nProcessCpu = -1, $nOverLimit = 0 While ProcessExists($vProcess) $nProcessCpu = _ProcessCPU($vProcess, $nScriptPriority) If $nProcessCpu > 50 Then $nOverLimit += 1 Else $nOverLimit = 0 EndIf If $nOverLimit > $nLimit Then $nOverLimit = 0 ProcessClose($vProcess) ; < - Replace this with what you need. EndIf Sleep($nInterval*1000) WEnd EndFunc Func _ProcessCPU($nPID = @AutoItPID, $nScriptPriority = 2) ; Realtime priority = 5 ; Original Author: Beege -> $nPID = ProcessExists($nPID) If Not $nPID Then Return SetError(1, 0, "") EndIf Local Const $tagFILETIME = "struct;dword Lo;dword Hi;endstruct", $nStructs = 7 Local Static $aStruct[$nStructs], $aPointer[$nStructs], $aStat[4], $hProcess = _WinAPI_OpenProcess(0x1F0FFF, 0, $nPID, True), $bFirstRun = True Local Enum $nIDLETIME, $nKERNELTIME, $nUSERTIME, $nPCreationTime, $nPExitTime, $nPKernelTime, $nPUserTime, _ $nProcStartKern = 0, $nProcStartUser, $nStartKernel, $nStartUser If $bFirstRun Then For $i = 0 To $nStructs - 1 Step 1 $aStruct[$i] = DllStructCreate($tagFILETIME) $aPointer[$i] = DllStructGetPtr($aStruct[$i]) Next EndIf DllCall('Kernel32.dll', "int", "GetSystemTimes", "ptr", $aPointer[$nIDLETIME], "ptr", $aPointer[$nKERNELTIME], "ptr", $aPointer[$nUSERTIME]) DllCall('Kernel32.dll', "int", "GetProcessTimes", "hwnd", $hProcess, "ptr", $aPointer[$nPCreationTime], "ptr", $aPointer[$nPExitTime], "ptr", _ $aPointer[$nPKernelTime], "ptr", $aPointer[$nPUserTime]) Local $aTemp[4] = [DllStructGetData($aStruct[$nPKernelTime], 1), DllStructGetData($aStruct[$nPUserTime], 1), DllStructGetData($aStruct[$nKERNELTIME], 1), _ DllStructGetData($aStruct[$nUSERTIME], 1)], $tProcess, $tSystem If Not $bFirstRun Then $tProcess = ($aTemp[$nProcStartKern] - $aStat[$nProcStartKern]) + ($aTemp[$nProcStartUser] - $aStat[$nProcStartUser]) $tSystem = ($aTemp[$nStartKernel] - $aStat[$nStartKernel]) + ($aTemp[$nStartUser] - $aStat[$nStartUser]) Else ProcessSetPriority(@AutoItPID, $nScriptPriority) $bFirstRun = False EndIf $aStat = $aTemp Return Int(Round(($tProcess / $tSystem) * 100)) EndFunc ;==>_ProcessCPU Edit - To give credit for source. Anonymous
  7. Version build 2014-08-27


    is a small tool in widget style to show the clock, current cpu usage, cpu speed, memory usage and network activity (tcp, ip and udp). Additionally you can use it as an alarm clock (to stop alarm clock tone press the left LED (mail) or wait 60 seconds). The current cpu usage code is beta and might be not working for some CPU models! Autoit SysInfo Clock should work with all operating systems beginning from Windows XP. Br, UEZ This project is discontinued!
  8. I'm making a Traymenu in systray to initiate a certain function automatically based on changes in @ipaddress. The While loop uses about 2-4 cpu constantly. Example: While 1 $msg = TrayGetMsg() Select Case $msg = 0 If $ipstring <> @IPAddress1 & @IPAddress2 & @IPAddress3 & @IPAddress4 Then _CheckIPs() ContinueLoop Case $msg = $connect _Connect() TrayItemSetState($connect, $tray_unchecked) Case $msg = $disconnect _Disconnect() EndIf ;Case $msg = $exititem ; ExitLoop EndSelect WEnd $ipstring = @IPAddress1 & @IPAddress2 & @IPAddress3 & @IPAddress4 is set inside _CheckIPs(). I've tried different solutins, but it seems that everything I try will utilize 2-4% CPU. I've also tried _DateDiff() before the $ipstring check, but _NowCalc() also uses CPU. Anyone got any ideas on how to solve this without utilizing the CPU?
  9. hello guys checkout this Code $array = ProcessList("explorer.exe") $iPID = $array[1][1] $sProcess = $iPID ;PID number for test process name ;~ $sProcess = "Idle" ;Other test process names ;~ $sProcess = "_Total" ;funny one ;~ $sProcess = "ntvdm" ;DOS process ;~ $sProcess = "AutoIt3" ;do not assign .exe to process name While 1 $iProcessCPU = _ProcessGetCPU($sProcess, 300 ) $sTip = "Process " & $sProcess & " CPU: " & $iProcessCPU & "%" traytip("", $sTip ,1) ;~ sleep(1000) ;set your own sleep time for LOOP mode WEnd Func _ProcessGetCPU($strProcess = "Idle", $iSampleTime = 10, $sComputerName = @ComputerName) ;~ All Parameters are optional: ;~ - Idle process will be measured if first parameter is not set ;~ - 500 ms is default sample time ;~ - This computer will be measured by default ;~ Process could be string ("Name") or PID number (1234) ;~ When more processes are runing with identical name, then the last opened is measured (use PID for other) ;~ For NORMAL MODE(one time measuring): set Sample value to more than 0 ms ;~ ( average CPU usage will be measured during sleep time within function) ;~ For LOOP MODE (continuous measuring): set Sample value to 0 ms ;~ ( average CPU usage will be measured between two function calls ) ;~ Total CPU usage is: ( 100 - _ProcessGetCPU()) ;~ Success: Returns process CPU usage in percent ;~ (Sample times below 100ms may return inaccurate results) ;~ (First result in Loop Mode may be inaccurate, ;~ because first call in Loop Mode is only used to trigger counters) ;~ Failure: Returns -1 ( wrong process name or PID ) ;~ : Returns -2 ( WMI service not found or Computer not found) if $strProcess = "" then $strProcess = "Idle" if $iSampleTime = "" AND IsString($iSampleTime) then $iSampleTime = 500 if $sComputerName = "" then $sComputerName = @ComputerName if not IsDeclared("iP1") AND $iSampleTime = 0 then ;first time in loop mode $bFirstTimeInLoopMode = 1 else $bFirstTimeInLoopMode = 0 endif if not IsDeclared("iP1") then assign("iP1", 0, 2) ;forced global declaration first time assign("iT1", 0, 2) endif $objWMIService = ObjGet("winmgmts:\\" & $sComputerName & "\root\CIMV2") if @error then return -2 if number($strProcess) then $strProcess = " WHERE IDProcess = '" & $strProcess & "'" else $strProcess = " WHERE Name = '" & $strProcess & "'" endif if $iSampleTime OR $bFirstTimeInLoopMode = 1 then ;skip if Loop Mode, but not First time $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess) For $objItem In $colItems $iT1 = $objItem.TimeStamp_Sys100NS $iP1 = $objItem.PercentProcessorTime next if $objItem = "" then return -1 ;process not found sleep($iSampleTime) endif $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess) For $objItem In $colItems $iP2 = $objItem.PercentProcessorTime $iT2 = $objItem.TimeStamp_Sys100NS next if $objItem = "" then return -1 ;process not found $iPP = ($iP2 - $iP1) $iTT = ($iT2 - $iT1) if $iTT = 0 Then return 100 ;do not divide by 0 $iCPU = round( ($iPP/$iTT) * 100, 0) $iP1 = $iP2 $iT1 = $iT2 Return $iCPU EndFunc ;==>_ProcessGetCPU() by novaTek ...ver 0.11 ok as you see this will show you your Explorer.exe in tip, im wondering about how to make this show you the CPU Usage in The Progress bar Lets say we will put the CPU usage in this progress bar #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 129, 192, 124) $Progress1 = GUICtrlCreateProgress(32, 16, 545, 89) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd i hope someone know how to ..