aboutsummaryrefslogtreecommitdiff
path: root/ja_JP.eucJP/man/man1/time.1
blob: c76fe8fb673e8e5682fc16b4701f16c268b5203f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.\" Copyright (c) 1980, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)time.1	8.1 (Berkeley) 6/6/93
.\" %FreeBSD: src/usr.bin/time/time.1,v 1.13.2.1 2000/10/30 10:02:00 obrien Exp %
.\" jpman %Id: time.1,v 1.3 1997/07/27 12:00:02 horikawa Stab %
.\"
.Dd June 6, 1993
.Dt TIME 1
.Os BSD 4
.Sh 名称
.Nm time
.Nd コマンドの実行時間の計測
.Sh 書式
.Nm
.Op Fl al
.Op Fl h | Fl p
.Op Fl o Ar file
.Ar command
.Sh 解説
.Nm
は
タイマーを初期化して、シェルに
.Ar command
を実行させ、処理に要した時間を計測します。
.Ar command
の実行を終えると、
実行開始から実際に経過した時間、
.Ar command
の実行に要した時間、
システムのオーバヘッドに費された時間を、(秒単位で) 標準エラー出力に出力します。
.Pp
使用可能なオプション:
.Bl -tag -width Ds
.It Fl a
.Fl o
が使用されている場合、上書きするのではなく、指定されたファイルに追加します。
.Fl o
が使用されていない場合には、このオプションは効果ありません。
.It Fl h
人に優しい書式で時刻を表示します。
時刻は、分や時間等の適切な書式で表示されます。
.It Fl l
デフォルトの出力に加え、
.Em rusage
構造体の内容を表示します。
.It Fl o Ar file
出力を標準エラー出力ではなく
.Ar file
に対して行います。
.Ar file
が存在し、
.Fl a
フラグが指定されなかった場合、ファイルは上書きされます。
.It Fl p
POSIX.2 に従った出力を、
.Nm
にさせます (各時間が各行に表示されます)。
.El
.Pp
シェルによっては、本ユーティリティと似たまたは同じ、組み込みの
.Nm
コマンドを提供しているものがあります。
.Xr builtin 1
マニュアルページを参照してください。
.Sh 診断
.Ar command
を成功裏に時間計測できた場合、コマンドの終了状態が返されます。
.Ar command
が異常終了した場合、警告メッセージが標準エラー出力に出力されます。
.Ar command
が見付かったものの実行できなかった場合、終了状態は 126 になります。
.Ar command
が見付からなかった場合、終了状態は 127 になります。
.Nm
が他のエラーとなった場合、終了状態は 1 以上 125 以下となります。
.Sh 関連項目
.Xr builtin 1 ,
.Xr csh 1 ,
.Xr getrusage 2 ,
.Xr wait 2
.Sh 規格
.Nm
ユーティリティは、
ISO/IEC 9945-2:1993 (``POSIX'') に従っていると期待されています。
.Sh 歴史
.Nm
は
.At v6
から登場しました。