]> git.saurik.com Git - apple/shell_cmds.git/blame - systime/systime.1
shell_cmds-187.tar.gz
[apple/shell_cmds.git] / systime / systime.1
CommitLineData
57cab491
A
1.Dd April 24, 2012\r
2.Dt systime 1\r
3.Os Darwin\r
4.Sh NAME\r
5.Nm systime\r
6.Nd gather system-wide time during program execution\r
7.Sh SYNOPSIS\r
8.Nm\r
9.Op Fl P\r
b5fe885e
A
10.Op Fl r\r
11.Op Fl t Ar sleep_time\r
57cab491
A
12.Ar utility Op Ar argument ...\r
13.Nm\r
14.Fl p\r
b5fe885e
A
15.Op Fl r\r
16.Op Fl t Ar sleep_time\r
57cab491
A
17.Nm\r
18.Op Fl P\r
19.Fl u Ar user\r
20.Fl s Ar sys\r
21.Fl i Ar idle\r
b5fe885e
A
22.Nm\r
23.Op Fl P\r
24.Op Fl r\r
25.Op Fl t Ar sleep_time\r
26.Fl T Ar target_pid\r
57cab491
A
27.Sh DESCRIPTION\r
28.Nm\r
29is similar to\r
30.Xr time 1\r
31in that it allows you to execute a utility program. However after execution\r
32completes, it reports the system-wide time that was spent\r
33during that time period, instead of just the portion directly caused\r
34by the utility. This can be used to gather information about CPU\r
35utilization by kernel threads (AIO, networking) and interrupt routines\r
36on behalf of a program, but not directly attributed to it.\r
37.Pp\r
38The\r
39.Nm\r
40program can also be used to snapshot counters with\r
41.Fl p\r
42and then later used with\r
43.Fl u Fl s Fl i\r
44to calculate time spent during a time interval that doesn't correlate\r
45to a specific command execution. For example:\r
46.Pp\r
47.Bd -ragged -offset indent\r
48$ eval `systime -p`\r
49.Pp\r
50$ ... time passes ...\r
51.Pp\r
52$ systime -u $systime_user -s $systime_sys -i $systime_idle\r
53.Pp\r
5418.79 real 2.03 user 1.04 sys\r
55.Ed\r
56.Pp\r
b5fe885e
A
57The\r
58.Nm\r
59program can also be used to print the usage of a process with\r
60.Fl T Ar target_pid\r
61, also printing the system wide usage\r
62.Pp\r
57cab491
A
63.Fl P\r
64can be used to print time spent as a percentage of overall CPU capacity\r
65of the system (capped at 100%)\r
b5fe885e
A
66.Pp\r
67.Fl r\r
68can be used to print the usage iteratively with\r
69.Ar sleep_time\r
70seconds sleep between iterations\r
71.Pp\r
72.Fl t Ar sleep_time\r
73can be used to specify sleep_time between iterations, defaults to 1 second if not specified.\r
57cab491
A
74.Sh SEE ALSO\r
75.Xr time 1 ,\r
76.Xr top 1\r