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