OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / draft / man1 / time.1
1 .\" Copyright Andries Brouwer, 2000
2 .\"
3 .\" This page is distributed under GPL.
4 .\" Some fragments of text came from the time-1.7 info file.
5 .\" Inspired by kromJx@crosswinds.net.
6 .\"
7 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
8 .\"         all rights reserved.
9 .\" Translated 2008-11-20, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
10 .\" 
11 .TH TIME 1 2008-11-14 "" "Linux User's Manual"
12 .\"O .SH NAME
13 .SH 名前
14 .\"O time \- time a simple command or give resource usage
15 time \- コマンドの時間計測やリソース使用量を表示する
16 .\"O .SH SYNOPSIS
17 .SH 書式
18 .BI "time [" options "] " command " [" arguments... "] "
19 .\"O .SH DESCRIPTION
20 .SH 説明
21 .\"O The
22 .\"O .B time
23 .\"O command runs the specified program
24 .\"O .I command
25 .\"O with the given arguments.
26 .B time
27 コマンドは、指定されたプログラム
28 .I command
29 を渡された引き数で実行する。
30 .\"O When
31 .\"O .I command
32 .\"O finishes,
33 .\"O .B time
34 .\"O writes a message to standard error giving timing statistics
35 .\"O about this program run.
36 .I command
37 が終了すると、
38 .B time
39 はこのプログラムの実行時間の統計情報についてのメッセージを
40 標準エラー出力に出力する。
41 .\"O These statistics consist of (i) the elapsed real time
42 .\"O between invocation and termination, (ii) the user CPU time
43 .\"O (the sum of the
44 .\"O .I tms_utime
45 .\"O and
46 .\"O .I tms_cutime
47 .\"O values in a
48 .\"O .I "struct tms"
49 .\"O as returned by
50 .\"O .BR times (2)),
51 .\"O and (iii) the system CPU time (the sum of the
52 .\"O .I  tms_stime
53 .\"O and
54 .\"O .I tms_cstime
55 .\"O values in a
56 .\"O .I "struct tms"
57 .\"O as returned by
58 .\"O .BR times (2)).
59 表示される統計情報は以下の三つから構成される:
60 (i) 起動から終了までに経過した実時間 (real time)、
61 (ii) ユーザ CPU 時間
62 .RB ( times (2)
63 が返す
64 .I "struct tms"
65
66 .I tms_utime
67
68 .I tms_cutime
69 の値の合計)、
70 (iii) システム CPU 時間
71 .RB ( times (2)
72 が返す
73 .I "struct tms"
74
75 .I tms_stime
76
77 .I tms_cstime
78 の値の合計)。
79
80 .\"O Note: some shells (e.g.,
81 .\"O .BR bash (1))
82 .\"O have a built-in
83 .\"O .B time
84 .\"O command that provides less functionality than the command described here.
85 .\"O To access the real command, you may need to specify its pathname
86 .\"O (something like
87 .\"O .IR /usr/bin/time ).
88 .RB ( bash (1)
89 などの) いくつかのシェルには、ここで説明するコマンドよりも
90 機能が少ない、組み込みの
91 .B time
92 コマンドが存在する。
93 組み込みではない実際のコマンドを使用するためには、
94 .RI ( /usr/bin/time
95 のような) コマンドのパス名を指定する必要があるかもしれない。
96 .\"O .SH OPTIONS
97 .SH オプション
98 .TP
99 .B \-p
100 .\"O When in the POSIX locale, use the precise traditional format
101 .\"O .br
102 .\"O .in +5
103 .\"O "real %f\enuser %f\ensys %f\en"
104 .\"O .in -5
105 .\"O .br
106 .\"O (with numbers in seconds)
107 .\"O where the number of decimals in the output for %f is unspecified
108 .\"O but is sufficient to express the clock tick accuracy, and at least one.
109 POSIX ロケールの場合、伝統的なフォーマットである
110 .in +5
111 "real %f\enuser %f\ensys %f\en"
112 .in -5
113 が使用される (各数字は秒単位)。
114 %f の出力での小数点以下の桁数は規定されていないが、
115 クロック・ティック (clock tick) の精度を表すのに十分な桁数となり、
116 少なくとも一桁は存在する。
117 .\"O .SH "EXIT STATUS"
118 .SH 終了ステータス
119 .\"O If
120 .\"O .I command
121 .\"O was invoked, the exit status is that of
122 .\"O .IR command .
123 .\"O Otherwise it is 127 if
124 .\"O .I command
125 .\"O could not be found, 126 if it could be found but could not be invoked,
126 .\"O and some other nonzero value (1-125) if something else went wrong.
127 .I command
128 が起動された場合は、
129 .I command
130 の終了ステータスが終了ステータスとなる。
131 .I command
132 が見つからなかった場合は終了ステータスは 127 で、
133 .I command
134 が見つかったが起動できなかった場合は 126 となる。
135 これ以外で何かエラーがあった場合は、終了ステータスは
136 0 以外の前記以外の値 (1-125) の何かになる。
137 .\"O .SH ENVIRONMENT
138 .SH 環境変数
139 .\"O The variables
140 .\"O .BR LANG ,
141 .\"O .BR LC_ALL ,
142 .\"O .BR LC_CTYPE ,
143 .\"O .BR LC_MESSAGES ,
144 .\"O .BR LC_NUMERIC ,
145 .\"O .BR NLSPATH ,
146 .\"O and
147 .\"O .B PATH
148 .\"O are used.
149 環境変数
150 .BR LANG ,
151 .BR LC_ALL ,
152 .BR LC_CTYPE ,
153 .BR LC_MESSAGES ,
154 .BR LC_NUMERIC ,
155 .BR NLSPATH ,
156 .B PATH
157 が使用される。
158 .\"O The last one to search for
159 .\"O .IR command .
160 .\"O The remaining ones for the text and formatting of the output.
161 .B PATH
162
163 .I command
164 を探すのに使われる。それ以外は出力文字や書式に使用される。
165 .\"O .SH "GNU VERSION"
166 .SH GNU バージョン
167 .\"O Below a description of the GNU 1.7 version of
168 .\"O .BR time .
169 .\"O Disregarding the name of the utility, GNU makes it output lots of
170 .\"O useful information, not only about time used, but also on other
171 .\"O resources like memory, I/O and IPC calls (where available).
172 .\"O The output is formatted using a format string that can be specified
173 .\"O using the \-f option or the
174 .\"O .B TIME
175 .\"O environment variable.
176 以下は GNU 1.7 バージョンの
177 .BR time
178 の説明である。コマンド名とは裏腹に、GNU バージョンでは
179 有益な情報がたくさん出力される。使用時間だけでなく、
180 (取得できる場合には) メモリや I/O、IPC 呼び出しなどの他のリソース
181 に関する情報も出力される。
182 出力はフォーマット文字列を使って整形され、
183 フォーマット文字列は \-f オプションか環境変数
184 .B TIME
185 で指定できる。
186 .LP
187 .\"O The default format string is
188 デフォルトのフォーマット文字列は以下の通り。
189 .br
190 .in +3
191 %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
192 .br
193 %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
194 .br
195 .in -3
196 .LP
197 .\"O When the \-p option is given the (portable) output format
198 \-p オプションが指定された場合には、(他と互換性のある) 出力
199 フォーマットが使用される。
200 .br
201 .in +3
202 real %e
203 .br
204 user %U
205 .br
206 sys %S
207 .br
208 .in -3
209 .\"O is used.
210 .\"O .SS "The format string"
211 .SS "フォーマット文字列"
212 .\"O The format is interpreted in the usual printf-like way.
213 .\"O Ordinary characters are directly copied, tab, newline
214 .\"O and backslash are escaped using \et, \en and \e\e,
215 .\"O a percent sign is represented by %%, and otherwise %
216 .\"O indicates a conversion.
217 .\"O The program
218 .\"O .B time
219 .\"O will always add a trailing newline itself.
220 .\"O The conversions follow.
221 .\"O All of those used by
222 .\"O .BR tcsh (1)
223 .\"O are supported.
224 フォーマットはよくある printf 形式で解釈される。
225 通常の文字はそのままコピーされ、
226 タブ、改行 (newline)、バックスラッシュはそれぞれ \et, \en, \e\e で
227 エスケープされる。
228 パーセント記号は %% で表現され、それ以外の % は変換を示す。
229 末尾には必ず改行文字 (newline) が追加される。
230 変換は以下の通りである。
231 .BR tcsh (1)
232 で使用される変換は全てサポートされている。
233 .LP
234 .B "Time"
235 .TP
236 .B %E
237 .\"O Elapsed real time (in [hours:]minutes:seconds).
238 経過した実時間 ([hours:]minutes:seconds の形式)。
239 .TP
240 .B %e
241 .\"O (Not in tcsh.) Elapsed real time (in seconds).
242 (tcsh にはない) 経過した実時間 (秒単位)。
243 .TP
244 .B %S
245 .\"O Total number of CPU-seconds that the process spent in kernel mode.
246 そのプロセスがカーネルモードで消費した CPU 時間の合計 (秒単位)。
247 .TP
248 .B %U
249 .\"O Total number of CPU-seconds that the process spent in user mode.
250 そのプロセスがユーザモードで消費した CPU 時間の合計 (秒単位)。
251 .TP
252 .B %P
253 .\"O Percentage of the CPU that this job got, computed as (%U + %S) / %E.
254 このジョブが獲得した CPU の割り合い (パーセンテージ)。
255 (%U + %S) / %E で計算される。
256 .LP
257 .B "Memory"
258 .TP
259 .B %M
260 .\"O Maximum resident set size of the process during its lifetime, in Kbytes.
261 プロセス生存中のそのプロセスの resident set size の最大値。
262 キロバイト単位。
263 .TP
264 .B %t
265 .\"O (Not in tcsh.) Average resident set size of the process, in Kbytes.
266 (tcsh にはない)
267 そのプロセスの resident set size の平均値。
268 キロバイト単位。
269 .TP
270 .B %K
271 .\"O Average total (data+stack+text) memory use of the process,
272 .\"O in Kbytes.
273 そのプロセスのメモリ使用量の合計 (データ+スタック+テキスト) の平均値。
274 キロバイト単位。
275 .TP
276 .B %D
277 .\"O Average size of the process's unshared data area, in Kbytes.
278 そのプロセスの非共有データ領域の平均サイズ。
279 キロバイト単位。
280 .TP
281 .B %p
282 .\"O (Not in tcsh.) Average size of the process's unshared stack space, in Kbytes.
283 (tcsh にはない)
284 そのプロセスの非共有スタック空間の平均サイズ。
285 キロバイト単位。
286 .TP
287 .B %X
288 .\"O Average size of the process's shared text space, in Kbytes.
289 そのプロセスの共有テキスト空間の平均サイズ。
290 キロバイト単位。
291 .TP
292 .B %Z
293 .\"O (Not in tcsh.) System's page size, in bytes.
294 .\"O This is a per-system constant, but varies between systems.
295 (tcsh にはない) システムのページサイズ (バイト単位)。
296 この値はシステム毎に決まる定数だが、システムにより異なる。
297 .TP
298 .B %F
299 .\"O Number of major page faults that occurred while the process was running.
300 .\"O These are faults where the page has to be read in from disk.
301 プロセスの動作中に発生したメジャーページフォルトの回数。
302 これは、ディスクからページを読み込む必要があったページフォルトに
303 関するものである。
304 .TP
305 .B %R
306 .\"O Number of minor, or recoverable, page faults.
307 .\"O These are faults for pages that are not valid but which have
308 .\"O not yet been claimed by other virtual pages.  Thus the data
309 .\"O in the page is still valid but the system tables must be updated.
310 マイナーページフォールト、つまり回復可能なページフォルトの回数。
311 これは、そのページは有効でないが、まだ他の仮想ページに奪われて
312 いなかったページに対するページフォルトに関するものである。
313 .TP
314 .B %W
315 .\"O Number of times the process was swapped out of main memory.
316 そのプロセスが主記憶からスワップアウトされた回数。
317 .TP
318 .B %c
319 .\"O Number of times the process was context-switched involuntarily
320 .\"O (because the time slice expired).
321 そのプロセスが (タイムスライスの経過により) 強制的にコンテキストスイッチ
322 された回数。
323 .TP
324 .B %w
325 .\"O Number of waits: times that the program was context-switched voluntarily,
326 .\"O for instance while waiting for an I/O operation to complete.
327 wait の回数、つまりそのプログラムが自発的にコンテキストスイッチされた回数。
328 例えば、I/O 操作の完了を待っている間などが該当する。
329 .LP
330 .B "I/O"
331 .TP
332 .B %I
333 .\"O Number of file system inputs by the process.
334 そのプロセスによるファイルシステムからの入力の回数。
335 .TP
336 .B %O
337 .\"O Number of file system outputs by the process.
338 そのプロセスによるファイルシステムへの出力の回数。
339 .TP
340 .B %r
341 .\"O Number of socket messages received by the process.
342 そのプロセスが受信したソケットメッセージ数。
343 .TP
344 .B %s
345 .\"O Number of socket messages sent by the process.
346 そのプロセスが送信したソケットメッセージ数。
347 .TP
348 .B %k
349 .\"O Number of signals delivered to the process.
350 そのプロセスに配送されたシグナル数。
351 .TP
352 .B %C
353 .\"O (Not in tcsh.) Name and command line arguments of the command being timed.
354 (tcsh にはない) time の対象となったコマンド名とコマンドライン引き数。
355 .TP
356 .B %x
357 .\"O (Not in tcsh.) Exit status of the command.
358 (tcsh にはない) コマンドの終了ステータス。
359 .\"O .SS "GNU Options"
360 .SS "GNU オプション"
361 .TP
362 .BI "\-f " FORMAT ", \-\-format=" FORMAT
363 .\"O Specify output format, possibly overriding the format specified
364 .\"O in the environment variable TIME.
365 出力フォーマットを指定する。
366 環境変数
367 .B TIME
368 で指定されたフォーマットよりも優先される。
369 .TP
370 .B "\-p, \-\-portability"
371 .\"O Use the portable output format.
372 他の time と互換性のある出力フォーマットを使用する。
373 .TP
374 .BI "\-o " FILE ", \-\-output=" FILE
375 .\"O Do not send the results to \fIstderr\fp, but overwrite the specified file.
376 結果を \fIstderr\fP に送らず、指定されたファイルに書き込む。
377 ファイルは上書きされる。
378 .TP
379 .B "\-a, \-\-append"
380 .\"O (Used together with \-o.) Do not overwrite but append.
381 (\-o と一緒に使用する。)
382 ファイルを上書きせずに、結果をファイル末尾に追加する。
383 .TP
384 .B "\-v, \-\-verbose"
385 .\"O Give very verbose output about all the program knows about.
386 非常に詳しい出力で、入手できる全ての情報を出力する。
387 .\"O .SS "GNU Standard Options"
388 .SS "GNU 標準オプション"
389 .TP
390 .B "\-\-help"
391 .\"O Print a usage message on standard output and exit successfully.
392 使用方法に関するメッセージを標準出力に表示し、正常終了する。
393 .TP
394 .B "\-V, \-\-version"
395 .\"O Print version information on standard output, then exit successfully.
396 バージョン情報を標準出力に表示し、正常終了する。
397 .TP
398 .B "\-\-"
399 .\"O Terminate option list.
400 オプションリストの末尾を示す。
401 .\"O .SH BUGS
402 .SH バグ
403 .\"O Not all resources are measured by all versions of UNIX,
404 .\"O so some of the values might be reported as zero.
405 .\"O The present selection was mostly inspired by the data
406 .\"O provided by 4.2 or 4.3BSD.
407 全てのリソースが UNIX の全てのバージョンで計測されているわけではないので、
408 いくつかの値が 0 と報告される可能性がある。
409 現在の出力項目のほとんどは 4.2BSD や 4.3BSD で取得可能なデータに
410 基づいて選択されている。
411 .LP
412 .\"O GNU time version 1.7 is not yet localized.
413 .\"O Thus, it does not implement the POSIX requirements.
414 GNU time バージョン 1.7 はまだローカライズされていない。
415 そのため、POSIX の要件を実装していないことになる。
416 .LP
417 .\"O The environment variable
418 .\"O .B TIME
419 .\"O was badly chosen.
420 .\"O It is not unusual for systems like
421 .\"O .BR autoconf (1)
422 .\"O or
423 .\"O .BR make (1)
424 .\"O to use environment variables with the name of a utility to override
425 .\"O the utility to be used.
426 .\"O Uses like MORE or TIME for options to programs
427 .\"O (instead of program pathnames) tend to lead to difficulties.
428 .B TIME
429 という環境変数は名前の選択がまずい。
430 .BR autoconf (1)
431
432 .BR make (1)
433 のようなシステムでは、使用するコマンドを上書きするのにそのコマンドの
434 名前の環境変数を使うのが珍しくない。
435 MORE や TIME のような名前を (プログラムのパス名の指定ではなく)
436 プログラムへのオプションを指定するのに使うと、
437 面倒なことを引き起こす可能性が高い。
438 .LP
439 .\"O It seems unfortunate that \-o overwrites instead of appends.
440 .\"O (That is, the \-a option should be the default.)
441 \-o が追記ではなく上書きになっているのは残念なことだ
442 (つまり \-a オプションがデフォルトになっているべきだろうということだ)。
443 .LP
444 .\"O Mail suggestions and bug reports for GNU
445 .\"O .B time
446 .\"O to
447 .\"O .br
448 .\"O .I bug\-utils@prep.ai.mit.edu
449 .\"O .br
450 .\"O Please include the version of
451 .\"O .BR time ,
452 .\"O which you can get by running
453 .\"O .br
454 .\"O .I time \-\-version
455 .\"O .br
456 .\"O and the operating system
457 .\"O and C compiler you used.
458 GNU
459 .B time
460 に対する提案やバグレポートは
461 .br
462 .I bug\-utils@prep.ai.mit.edu
463 .br
464 までメールを送ってほしい。
465 その場合には
466 .B time
467 や OS、使用している C コンパイラの
468 バージョンを記載してほしい。
469 .B time
470 のバージョンは以下のコマンドで取得できる。
471 .br
472 .I time \-\-version
473 .br
474 .\" .SH AUTHORS
475 .\" .TP
476 .\" .IP "David Keppel"
477 .\" Original version
478 .\" .IP "David MacKenzie"
479 .\" POSIXization, autoconfiscation, GNU getoptization,
480 .\" documentation, other bug fixes and improvements.
481 .\" .IP "Arne Henrik Juul"
482 .\" Helped with portability
483 .\" .IP "Francois Pinard"
484 .\" Helped with portability
485 .\"O .SH "SEE ALSO"
486 .SH 関連項目
487 .BR tcsh (1),
488 .BR times (2),
489 .BR wait3 (2)