.\" 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 .\" 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 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 l デフォルトの出力に加え、 .Em rusage 構造体の内容を表示します。 .It Fl o Ar file 出力を標準エラー出力ではなく .Ar file に対して行います。 .Ar file が存在し、 .Fl a フラグが指定されなかった場合、ファイルは上書きされます。 .El .Pp .Xr csh 1 は独自の .Nm をビルトインコマンドとして実装しています。 シェルに .Xr csh を使用している場合、 ここで説明されている .Nm を実行するときは .Pa /usr/bin/time とタイプして下さい。 .Sh 関連項目 .Xr csh 1 , .Xr getrusage 2 , .Xr wait 2 .Sh 歴史 .Nm は .At v6 から登場しました。