Class ProcessCpuUsage

Definition

Namespace:
Tizen.System
Assembly:
Tizen.System.Information.dll

The class for CPU usage per given list of process.

C#
Copy
public class ProcessCpuUsage
Inheritance
object
ProcessCpuUsage

Constructors

View Source

ProcessCpuUsage(IEnumerable<int>)

The constructor of ProcessCpuUsage class of the given list of process. It internally call Update() on constructing an instance.

Declaration
C#
Copy
public ProcessCpuUsage(IEnumerable<int> pid)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T><int> pid

List of unique process ids.

Exceptions
Type Condition
System.ArgumentException

Thrown when the pid is empty.

System.IO.IOException

Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon.

System.OutOfMemoryException

Thrown when the memory is not enough to allocate.

System.UnauthorizedAccessException

Thrown when the caller does not have privilege to use this method.

Properties

View Source

Count

The number of processes being tracked by the instance.

Declaration
C#
Copy
public int Count { get; }
Property Value
Type Description
int

Methods

View Source

GetSTime(int)

Gets the amount of time this process has been scheduled in kernel mode. To get the latest value, it is recommended to call Update() before it.

Declaration
C#
Copy
public uint GetSTime(int pid)
Parameters
Type Name Description
int pid

The process id.

Returns
Type Description
uint

The amount of time pid has been scheduled in kernel mode (clock ticks).

Exceptions
Type Condition
System.ArgumentException

Thrown when the pid is invalid.

View Source

GetUTime(int)

Gets the amount of time this process has been scheduled in user mode. To get the latest value, it is recommended to call Update() before it.

Declaration
C#
Copy
public uint GetUTime(int pid)
Parameters
Type Name Description
int pid

The process id.

Returns
Type Description
uint

The amount of time pid has been scheduled in user mode (clock ticks).

Exceptions
Type Condition
System.ArgumentException

Thrown when the pid is invalid.

View Source

Update(IEnumerable<int>)

Update CPU usage of the given processes to the latest.

Declaration
C#
Copy
public void Update(IEnumerable<int> pid)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<T><int> pid

List of unique process ids.

Exceptions
Type Condition
System.ArgumentException

Thrown when the pid is empty.

System.IO.IOException

Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon.

System.OutOfMemoryException

Thrown when the memory is not enough to allocate.

System.UnauthorizedAccessException

Thrown when the caller does not have privilege to use this method.