Jump to content

kevin3

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by kevin3

  1. When using the above I got occasional negative values. Found it was due to the idle time value rolling over (only the PCU percentage was checked not the Process Percentage). Also sometimes it would have no time elapse between measurements (Some OS caching the function call?) which resulted in incorrect 0% CPU time for the measured Process. Here is the error checking: Func _ProcessCPUExample() Static Local $aEnd, $aStart = _GetProcessUsage($g_hAutoItProcess) sleep(2000) ; make sure some time elapses between measurements. $aEnd = _GetProcessUsage($g_hAutoItProcess) ;Make sure time value did not roll over while $aEnd[0] <= $aStart[0] or $aEnd[1] <= $aStart[1] or $aEnd[2] <= $aStart[2] ConsoleWrite('ReTrying'&@CRLF) $aStart = _GetProcessUsage($g_hAutoItProcess) sleep(2000) $aEnd = _GetProcessUsage($g_hAutoItProcess) WEnd ;Get both total and process cpu usage Local $aCPU = _CalcUsage($aStart, $aEnd) ConsoleWrite('Total CPU Usage = ' & $aCPU[0] & '%' & @TAB & @TAB & 'AutoIt CPU Usage = ' & $aCPU[1] & '%' & @LF) ;copy last cpu times to start. $aStart = $aEnd EndFunc ;==>_GetProcessCPU
  2. How do I click on a particular button in the Qwidget? For example with VLC media player, the play button? Thanks!
×
×
  • Create New...