• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# cpup
2
3
4## Command Function
5
6This command is used to query the CPU percent (CPUP) of the system.
7
8
9## Syntax
10
11cpup [_mode_] [_taskID_]
12
13
14## Parameters
15
16**Table 1** Parameter description
17
18| Parameter| Description| Value Range|
19| -------- | -------- | -------- |
20| mode | Displays the CPUP of the system within the last 10 seconds by default.<br>- **0**: displays the CPUP within the last 10 seconds.<br>- **1**: displays the CPUP within the last 1 second.<br>- Other numbers: display the total CPUP since the system starts.| [0, 0xFFFFFFFF] |
21| taskID | Specifies the task ID.| [0, 0xFFFFFFFF] |
22
23
24## Usage Guidelines
25
26- If no parameter is specified, the CPU usage of the system within the last 10 seconds is displayed.
27
28- If only **mode** is specified, the CPU usage within the specified period is displayed.
29
30- If both **mode** and **taskID** are specified, the CPU usage of the specified task within the given period is displayed.
31
32
33## Example
34
35Run **cpup 1 5**.
36
37
38## Output
39
40CPU usage of task 5 in the last one second:
41
42```
43OHOS # cpup 1 5pid 5
44
45CpuUsage in 1s: 0.0
46```
47