GetProcessCpuLoad

System function.

The GetProcessCpuLoad function returns the percentage CPU used by the specified process. Not available in WinTask Lite.

Syntax

Num=GetProcessCpuLoad(<process_name>[,<instance_number>])

Parameters

<process_name>, string, name of the process to measure.

<instance_number>, optional instance number; to be used if several instances of the same process are running.

Return value

Num, integer, CPU percentage used by the process <process_name>.

Num= -3 if the statistical function has failed (for example because the specified process does not exist)

Num= -4 if WinTaskAdmin Service is not started (under Vista).

Example

 

a=GetProcessCpuLoad("TASKEXEC.EXE")